kubectl run curl-debug -n monitoring --generator=run-pod/v1 --image=radial/busyboxplus:curl -i --tty --rm
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
Lesson 1 SUMMARY | |
1. The cursor is moved using either the arrow keys or the hjkl keys. | |
h (left) j (down) k (up) l (right) | |
2. To start Vim from the shell prompt type: vim FILENAME <ENTER> | |
3. To exit Vim type: <ESC> :q! <ENTER> to trash all changes. | |
OR type: <ESC> :wq <ENTER> to save the changes. |
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
Questions are not from any actual exam!!! | |
Q: Create a secret that has the following username password data: | |
username=missawesome | |
password=123kube321 | |
Create a pod running nginx that has access to those data items in a volume mount path at /tmp/secret-volume | |
log into the nginx pod you created and list the items and cat the output of the data items to a file "credentials.txt" |
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
<!DOCTYPE NETSCAPE-Bookmark-file-1> | |
<!-- This is an automatically generated file. | |
It will be read and overwritten. | |
DO NOT EDIT! --> | |
<META HTTP-EQUIV="Content-Type" CONTENT="text/html; charset=UTF-8"> | |
<TITLE>Bookmarks</TITLE> | |
<H1>Bookmarks</H1> | |
<DL><p> | |
<DT><H3 ADD_DATE="1578057396" LAST_MODIFIED="0" PERSONAL_TOOLBAR_FOLDER="true">Bookmarks bar</H3> | |
<DL><p> |
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
# cluster.yaml | |
# A cluster with managed nodegroup | |
# Setup aws profile if you have many: | |
# `export AWS_PROFILE=test` | |
# `export AWS_DEFAULT_PROFILE=test` | |
# Run the command: | |
# `eksctl create cluster -f cluster.yaml --write-kubeconfig --set-kubeconfig-context` | |
--- | |
apiVersion: eksctl.io/v1alpha5 | |
kind: ClusterConfig |
- Get the context :
CONTEXT=$(kubectl config current-context)
- Create the required service account and cluster role binding :
apiVersion: v1
kind: ServiceAccount
metadata:
Put the following in github webhook section:
https://jenkins.example.com/v1/generic-webhook-trigger/invoke?token=my-token&apiKey=xxxxxxxxxxxxxxxxxxxxxxxxxxxxxxx
where :
apiKey=xxxxxxxxxxxxxxxxxxxxxxxxxxxxxxx
is for API Gateway api key
token=my-token
is same as configured in Jenkins job
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
import boto3 | |
import os | |
import json | |
filename = 'data.json' | |
kms_id = '' | |
secretdata= {"username":"chris","password":"BnQw!XDWgaEeT9XGTT29"} | |
secret_data={} | |
for k,v in secretdata.items(): | |
encrypt_string = os.popen(("aws kms encrypt --key-id %s --plaintext '%s' --query CiphertextBlob --output text" % (kms_id, v))).read() | |
secret_data[k] = encrypt_string |
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
# Backup | |
docker exec CONTAINER /usr/bin/mysqldump -u root --password=root DATABASE > backup.sql | |
# Restore | |
cat backup.sql | docker exec -i CONTAINER /usr/bin/mysql -u root --password=root DATABASE | |