Skip to content

Instantly share code, notes, and snippets.

View prudhvigodithi's full-sized avatar

Prudhvi Godithi prudhvigodithi

View GitHub Profile
@prudhvigodithi
prudhvigodithi / .txt
Last active March 10, 2022 08:17
Kubectl cheat sheet.
kubectl run nginx image=nginx  --port=80  --record
kubectl set image deployment nginx nginx=nginx:1.2
kubectl rollout history deployment nginx
kubectl rollout status deployment nginx
kubectl rollout undo deployment nginx  --to-revision=2
kubectl autoscale deployment nginx  --cpu-percent=50  -- min=1  -- max 2
kubectl run nginx3  --image=nginx  --requests=cpu=200m  --limits=cpu=300m  --requests=memory=1Gi  --limits=memory=2Gi
kubectl run hello  --schedule=”*/1 * * * *”  --restart=OnFailure  -- image=busybox  -- /bin/sh -c “date; echo Hello from the kubernetes cluster”
kubectl port-forward redis-master-765d459796–258hz 6379:6379
kubectl get pods redis-master-765d459796–258hz -o yaml
apiVersion: sources.eventing.knative.dev/v1alpha1
kind: CronJobSource
metadata:
name: test-cronjob-source
spec:
schedule: "*/2 * * * *"
data: '{"message": "Hello ${name}"}'
sink:
apiVersion: serving.knative.dev/v1alpha1
kind: Service