Sun Dec 06 2020 19:48:45 GMT+0000 (Coordinated Universal Time)
Saved by @ankity09 #aws,ckad #eks
kubectl create namespace rbac-test
#aws,ckad
kubectl run frontend --image=nginx --port=80 \ -o yaml --dry-run=client > pod.yaml
kubectl edit pod frontend
FROM openjdk:11-jre-slim WORKDIR /app COPY target/java-hello-world-0.0.1.jar java-hello-world.jar ENTRYPOINT ["java", "-jar", "/app/java-hello-world.jar"] EXPOSE 8080
docker build -t java-hello-world:1.0.0 .
docker run -d -p 8080:8080 java-hello-world:1.0.0
kubectl run hazelcast --image=hazelcast/hazelcast --port=5701 \ --env="DNS_DOMAIN=cluster" --labels="app=hazelcast,env=prod"
apiVersion: v1 kind: Pod metadata: name: hazelcast labels: app: hazelcast env: prod spec: containers: - env: - name: DNS_DOMAIN value: cluster image: hazelcast/hazelcast name: hazelcast ports: - containerPort: 5701
kubectl describe pods hazelcast
kubectl logs pod/hazelcast
kubectl exec -it hazelcast -- /bin/sh
apiVersion: v1 kind: Pod metadata: name: spring-boot-app spec: containers: - image: bmuschko/spring-boot-app:1.5.3 name: spring-boot-app env: - name: SPRING_PROFILES_ACTIVE value: prod - name: VERSION value: '1.5.3'
apiVersion: v1 kind: Pod metadata: creationTimestamp: null labels: run: mypod name: mypod spec: containers: - command: ["/bin/sh"] args: ["-c", "while true; do date; sleep 10; done"] image: busybox name: mypod resources: {} dnsPolicy: ClusterFirst restartPolicy: Never status: {}
kubectl delete pod nginx --grace-period=0 --force
apiVersion: v1 kind: Pod metadata: name: ckad-nginx spec: containers: - name: nginx image: nginx:1.17.10 ports: - containerPort: 80 env: - name: DB_URL value: postgresql://mydb:5432 - name: DB_USERNAME value: admin
apiVersion: v1 kind: Pod metadata: creationTimestamp: null labels: run: loop name: loop spec: containers: - args: - /bin/sh - -c - while true; do date; sleep 10; done image: busybox name: loop resources: {} dnsPolicy: ClusterFirst restartPolicy: Never status: {}
Copy this HTML code:
Preview:
open_in_newInstructions on embedding in Medium
Comments