Question
What is a schema in Pulumi?
Answer
A schema is a JSON file of key-value pairs to specify resources. The files can be manually or automatically generated. You can read more on the Pulumi website.
…
A Technical I.T./DevOps Blog
Question
What is a schema in Pulumi?
Answer
A schema is a JSON file of key-value pairs to specify resources. The files can be manually or automatically generated. You can read more on the Pulumi website.
…
Problem scenario
You do not have the YAML (.yml or .yaml) files for your Helm deployments.
How do you find the pod manifests for the yaml files when you do not have access to the Helm repos?
Solution
Run this:
helm ls -a -A
The output will show a “Name” on the left most column and a namespace in an inner column.
…
Problem scenario
You want to craft an AWS CLI command to return the principal services of your IAM roles. You want the name and the ARN values of the roles to be printed along with the principal services. You the principal services data is in the AssumePolicyDocument. Your previous attempts have returned “None” for this value. What do you do?
Solution
Run a command like this:
aws iam list-roles –output text –query ‘Roles[*].[RoleName,Arn,AssumeRolePolicyDocument.Statement[*].Principal]’ …
Problem scenario
You want to list IAM roles that have access to EKS. You have the AWS CLI installed and jq installed. What should you do?
Solution
Run this command:
aws iam list-roles | jq -r ‘.Roles[] | select(.AssumeRolePolicyDocument.Statement[].Principal.Service==”eks.amazonaws.com”)’ …
Continue reading “What AWS CLI Command Can You Run to List Roles with EKS Access?”
Problem scenario
You want to return only the JSON of the output that is related to a specific role — not the entire list of an “aws iam list-roles” command. What do you do?
Solution
Prerequisite
You must have the AWS CLI installed. If you need assistance, see this posting.
Procedures
Use the “–query” flag.
…
Continue reading “How Do You Filter the Output of an AWS CLI Command?”
Problem scenario
You run a kubectl command, but you get this problem: ‘error: unable to recognize “foobar.yaml”: no matches for kind “Deployment” in version “extensions/v1beta1″‘
What should you do?
Solution
Change your yaml file so the apiVersion setting/value works. To learn more about the acceptable values, see this posting.
…
Continue reading “How Do You Troubleshoot the kubectl ‘version “extensions/v1beta1″‘ Error Message?”
Problem scenario
In the AWS Management Console, you cannot add a Node to an EKS cluster. The “Node IAM Role” never has any option. You click the “refresh” arrow, but all you see is “No roles found. Follow the link above to create a new role.” What should you do?
Solution
1. Install and configure the AWS CLI. If you need assistance with this,
…
Problem scenario
You want to do some pre-testing on the .yaml file(s) you will use with kubectl. How do you validate a .yaml file has correct syntax for Kubernetes?
Possible Solution #1
Try this command:
kubectl apply –validate=true –dry-run=true –filename=nameofyourfile.yaml
Possible Solution #2
Try this website:
https://www.kubeyaml.com/
Possible Solution #3
Try kubeval: https://www.kubeval.com/
Possible Solution #4
Use Copper: http://copper.sh/
…
Continue reading “How Do You Tell If the .yaml File for a kubectl Command Will Work?”
One of the following scenarios apply:
Problem scenario #1
You want to run a command like this:
aws iam put-role-policy –role-name contintdelete-role –policy-name DELETEPOLICY –policy-document file://adminPolicy.json
But you do not know the syntax of the adminPolicy.json.
Problem scenario #2
You are trying to use the –policy-document flag with the command “aws iam put-role-policy”. But you get this error:
An error occurred (MalformedPolicyDocument) when calling the PutRolePolicy operation: Syntax errors in policy.
…
Problem scenario
You want to print the value of a given non-nested key in a JSON value. How can Python help you achieve this?
Solution
Here is an illustrative example. Create a file called reader.py with the following lines of code:
import json
with open(“first.json”, “r”) as reading_content:
i = reading_content.read()
j = json.loads(i)
print(j[“bird”])
Have the JSON file look like this:
cat first.json
{“bird”: {“name”: “singy”, …
Continue reading “How Do You Read a JSON File to Extract the Value of a Given Key in a JSON File?”