-
Notifications
You must be signed in to change notification settings - Fork 4
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
feat : add Lifecycle to AppSpec #11
Conversation
lifecycle: | ||
postStart: | ||
exec: | ||
command: ["/bin/sh", "-c", "echo Hello from the postStart handler > /usr/share/message"] | ||
preStop: | ||
exec: | ||
command: ["/bin/sh","-c","nginx -s quit; while killall -0 nginx; do sleep 1; done"] |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
lifecycle 추가 안하고 돌렸을때는 문제 없이 돌아가나요?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
AppSpec
에 추가된 상태에서 위 lifecycle에 명시된 내용이 없는 경우를 말씀하시는 걸까요?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
make install
의 경우 지우고 실행해도 이전 yaml로 돌아가는 것 같아보이네요 😢
그런데 kubectl apply -f config/samples/app_v1alpha1_application.yaml
로 실행하면 명시된 필드가 비어있다고 실행되지 않습니다.
api/v1alpha1/application_types.go
Outdated
@@ -31,6 +31,7 @@ type AppSpec struct { | |||
AppType string `json:"appType,omitempty"` // back, front-spa, front-srr | |||
Annotations map[string]string `json:"annotations,omitempty"` | |||
ContainerName string `json:"containerName"` | |||
LifeCycle *v1.Lifecycle `json:"lifeCycle"` |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
LifeCycle *v1.Lifecycle `json:"lifeCycle"` | |
// +optional | |
LifeCycle *v1.Lifecycle `json:"lifeCycle,omitempty"` |
작업내역
✅ : AppSpec에 라이프사이클 관련 구조체 추가
✅ : UpsertDeployment에 Appspec의 추가된 내용 반영 코드 작성
추가된 내용
// +optional
추가