-
Notifications
You must be signed in to change notification settings - Fork 1.7k
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
增加脚本一键初始化脚本 #475
增加脚本一键初始化脚本 #475
Conversation
Codecov Report
@@ Coverage Diff @@
## master #475 +/- ##
=======================================
Coverage 81.51% 81.51%
=======================================
Files 74 74
Lines 9661 9661
=======================================
Hits 7875 7875
Misses 1786 1786 Continue to review full report at Codecov.
|
感谢贡献,方便的话可以添加微信 |
还有不要关闭PR,否则整个功能的沟通和讨论过程涉及多个PR,不便于追溯和检索 可以在PR对应分支强制推送来覆盖以前的提交 |
好的。 |
又关pr了 ,我很无语。 为什么要关掉 mysql 的持久化? createsuperuser可以做非交互式的,你查一下django文档,里面有,在values里面填 superuser password,不要在脚本里写死。 初始脚本可以考虑用 init containers吗? 对 postStart 不算特别了解,这个有日志吗? |
用了initcontainer,这个只能去等mysql,redis是否准备好,还只能是在postStart里执行,在pod准备好的时间,先执行初始化脚本。 |
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.
麻烦参考review进行修改
src/charts/values.yaml
Outdated
persistence: | ||
enabled: false | ||
# subchats mysql | ||
mysql: | ||
mysqlRootPassword: archery | ||
mysqlDatabase: archery | ||
persistence: | ||
enabled: true | ||
enabled: false |
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.
请开启持久化
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.
好的。
ii 集群外访问 | ||
将svc配置为nodePort或loadBalance,或开启ingress | ||
i 本机访问 kubectl port-forward pods/archery-xxxxxx 9123:9123 | ||
ii 集群外访问 将svc配置为nodePort或loadBalance,或开启ingress |
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.
麻烦增加一些ingress的配置吧。
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.
好的。
password=DJANGO_SU_PASSWORD) | ||
except: | ||
print('Error,用户重复创建或创建失败,请登录pod检查!') | ||
exit(0) |
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.
这里可以考虑 exit(127) 之类的吗? exit 0会认为是正常退出。
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.
目前暂时没有环境进行测试,当有已创建用户的异常时,应该是允许pod给正常ready,因没有分别捕捉出来,所以弄了一个0返回正常,这个到时候有环境了再修改。
增加脚本一键初始化脚本
还是使用了expect命令,因django目前还是没有找到相关生成密码的方法,创建用户,密码为空时不能登录;
expect需要安装,因没有在 images中打包好,当用户离线安装时,会生成问题。
如果有其他生成superuser的密码的方式,请告之。