Skip to content

Instantly share code, notes, and snippets.

View longwuyuan's full-sized avatar

Long Wu Yuan longwuyuan

  • enjoydevops.com
  • India
View GitHub Profile
Questions are not from any actual exam!!!
Q: Create a job that calculates pi to 2000 decimal points using the container with the image named perl
and the following commands issued to the container: ["perl", "-Mbignum=bpi", "-wle", "print bpi(2000)"]
Once the job has completed, check the logs to and export the result to pi-result.txt.
Solution:
# Get the K8S_URL and Token from Rancher Cluster level Kubeconfig (logged in as the CI user)
export K8S_URL=https://<rancherurl>/k8s/clusters/<clusterid>
export TOKEN=<RANCHERTOKEN>
export NAMESPACE=<kubernetes-namespace>
# Typically these are identical. Check from the YAML file of your deployment.
export DEPLOYMENT=<deployment-name>
export CONTAINER=<container-name>
# The docker-image-version must be updated every time you built a new container.
@mgoodness
mgoodness / k8s-svc-annotations.md
Last active September 7, 2024 16:25
AWS ELB-related annotations for Kubernetes Services (as of v1.12.0)
  • service.beta.kubernetes.io/aws-load-balancer-access-log-emit-interval (in minutes)
  • service.beta.kubernetes.io/aws-load-balancer-access-log-enabled (true|false)
  • service.beta.kubernetes.io/aws-load-balancer-access-log-s3-bucket-name
  • service.beta.kubernetes.io/aws-load-balancer-access-log-s3-bucket-prefix
  • service.beta.kubernetes.io/aws-load-balancer-additional-resource-tags (comma-separated list of key=value)
  • service.beta.kubernetes.io/aws-load-balancer-backend-protocol (http|https|ssl|tcp)
  • service.beta.kubernetes.io/aws-load-balancer-connection-draining-enabled (true|false)