- Basic structure
- oc [name]
- There are some exceptions, like
oc helporoc logs <pod>oroc exec - Most commands support
oc <command> --help
- Common resources (nouns)
- Pods
- Deployments
- Services
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: apps/v1 | |
| kind: Deployment | |
| metadata: | |
| annotations: | |
| deployment.kubernetes.io/revision: "1" | |
| kubectl.kubernetes.io/last-applied-configuration: | | |
| {"apiVersion":"apps/v1","kind":"Deployment","metadata":{"annotations":{},"labels":{"app":"basic-ocp-demo"},"name":"basic-ocp-demo","namespace":"basic-ocp-demo-project"},"spec":{"replicas":1,"selector":{"matchLabels":{"app":"basic-ocp-demo"}},"template":{"metadata":{"labels":{"app":"basic-ocp-demo"}},"spec":{"containers":[{"env":[{"name":"BASIC_OCP_DEMO_ENV","value":"master"}],"image":"quay.io/freedomben/basic-ocp-demo:latest","imagePullPolicy":"Always","name":"basic-ocp-demo","ports":[{"containerPort":4567,"protocol":"TCP"}],"readinessProbe":{"httpGet":{"path":"/healthz","port":4567,"scheme":"HTTP"},"initialDelaySeconds":5,"periodSeconds":1}}]}}}} | |
| creationTimestamp: "2021-01-08T02:09:21Z" | |
| generation: 1 | |
| labels: |
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
| from elasticsearch_dsl import Date, Document, Keyword, Nested, Text, Integer | |
| class HttpLog(Document): | |
| """The schema for a Log document.""" | |
| level = Keyword() | |
| request = Nested(properties={"body": Text(analyzer="snowball"), "headers": Keyword(), "arguments": Keyword()}) | |
| response = Nested(properties={"message": Text(analyzer="snowball"), "status": Integer()}) | |
| timestamp = Date() |
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
| provider "docker" {} | |
| variable wordpress_port { | |
| default = "8080" | |
| } | |
| resource "docker_volume" "db_data" {} | |
| resource "docker_network" "wordpress_net" { | |
| name = "wordpress_net" |
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
| resource "docker_container" "hello_world_app" { | |
| image = "hello_world_app:latest" | |
| name = "hello_world_app" | |
| restart = "always" | |
| volumes { | |
| container_path = "/myapp" | |
| # replace the host_path with full path for your project directory starting from root directory / | |
| host_path = "/path/to/your/project/directory" | |
| read_only = false | |
| } |
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
| provider "aws" { | |
| region = "ap-south-1" | |
| profile = "EKS" | |
| } | |
| resource "aws_iam_role" "eks_cluster" { | |
| name = "ViRocluster" | |
| assume_role_policy = <<POLICY |
-
Print containers of a pod
oc get pod <pod_name> -o jsonpath='{.spec.containers[*].name}{"\n"}' | tr ' ' '\n'
-
IBM Chart repo URI
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
| resource "docker_container" "hello_world_app" { | |
| image = "hello_world_app:latest" | |
| name = "hello_world_app" | |
| restart = "always" | |
| volumes { | |
| container_path = "/myapp" | |
| # replace the host_path with full path for your project directory starting from root directory / | |
| host_path = "/path/to/your/project/directory" | |
| read_only = false | |
| } |
Get the metadata and content of all files in a given GitHub repo using the GraphQL API
You might want to get a tree summary of files in a repo without downloading the repo, or maybe you want to lookup the contents of a file again without download the whole repo.
The approach here is to query data from GitHub using the Github V4 GraphQL API.