EKS cluster version:
Client Version: version.Info{Major:"1", Minor:"20", GitVersion:"v1.20.1", GitCommit:"c4d752765b3bbac2237bf87cf0b1c2e307844666", GitTreeState:"clean", BuildDate:"2020-12-19T11:45:27Z", GoVersion:"go1.15.5", Compiler:"gc", Platform:"linux/amd64"} Server Version: version.Info{Major:"1", Minor:"18+", GitVersion:"v1.18.9-eks-d1db3c", GitCommit:"d1db3c46e55f95d6a7d3e5578689371318f95ff9", GitTreeState:"clean", BuildDate:"2020-10-20T22:18:07Z", GoVersion:"go1.13.15", Compiler:"gc", Platform:"linux/amd64"}
Given below is my deployment file :
kind: Deployment
apiVersion: apps/v1
metadata:
name: sample-pod
namespace: front-end
spec:
replicas: 1
selector:
matchLabels:
app: sample-pod
template:
metadata:
labels:
app: sample-pod
spec:
serviceAccountName: my-service-account
containers:
- name: sample-pod
image: <Account-id>.dkr.ecr.us-east-1.amazonaws.com/sample-pod-image:latest
resources:
limits:
cpu: 1000m
memory: 1000Mi
requests:
cpu: 500m
memory: 500Mi
env:
- name: name
value: sample-pod
- name: ACTIVE_SPRING_PROFILE
value: dev
imagePullPolicy: Always
ports:
- name: http
containerPort: 8091
imagePullSecrets:
- name: <my_region>-1-ecr-registry
And this is my docker file.
FROM amazoncorretto:latest
COPY bootstarp.sh /bootstarp.sh
RUN yum -y install aws-cli
CMD ["tail", "-f" , "/bootstarp.sh"]
Steps to reproduce:
- kubectl apply -f my-dep.yaml
- Let container be create.
- Delete deployment using command kubectl delete -f my-dep.yaml
- Recreate using command apply -f my-dep.yaml