Skip to content
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

Merged
merged 11 commits into from
Nov 5, 2019
Merged

Conversation

jerryhu1234
Copy link
Contributor

增加脚本一键初始化脚本
还是使用了expect命令,因django目前还是没有找到相关生成密码的方法,创建用户,密码为空时不能登录;
expect需要安装,因没有在 images中打包好,当用户离线安装时,会生成问题。
如果有其他生成superuser的密码的方式,请告之。

@codecov
Copy link

codecov bot commented Oct 11, 2019

Codecov Report

Merging #475 into master will not change coverage.
The diff coverage is n/a.

Impacted file tree graph

@@           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.

Legend - Click here to learn more
Δ = absolute <relative> (impact), ø = not affected, ? = missing data
Powered by Codecov. Last update 056d859...8f73d07. Read the comment docs.

@jerryhu1234 jerryhu1234 deleted the archery-charts branch October 11, 2019 13:03
@jerryhu1234 jerryhu1234 restored the archery-charts branch October 11, 2019 13:07
@jerryhu1234 jerryhu1234 reopened this Oct 11, 2019
@hhyo
Copy link
Owner

hhyo commented Oct 11, 2019

感谢贡献,方便的话可以添加微信 rtttte 进开发群

@hhyo
Copy link
Owner

hhyo commented Oct 11, 2019

还有不要关闭PR,否则整个功能的沟通和讨论过程涉及多个PR,不便于追溯和检索

可以在PR对应分支强制推送来覆盖以前的提交

@jerryhu1234
Copy link
Contributor Author

还有不要关闭PR,否则整个功能的沟通和讨论过程涉及多个PR,不便于追溯和检索

可以在PR对应分支强制推送来覆盖以前的提交

好的。

@LeoQuote
Copy link
Collaborator

又关pr了 ,我很无语。

为什么要关掉 mysql 的持久化?

createsuperuser可以做非交互式的,你查一下django文档,里面有,在values里面填 superuser password,不要在脚本里写死。

初始脚本可以考虑用 init containers吗? 对 postStart 不算特别了解,这个有日志吗?

@jerryhu1234
Copy link
Contributor Author

又关pr了 ,我很无语。

为什么要关掉 mysql 的持久化?

createsuperuser可以做非交互式的,你查一下django文档,里面有,在values里面填 superuser password,不要在脚本里写死。

初始脚本可以考虑用 init containers吗? 对 postStart 不算特别了解,这个有日志吗?

用了initcontainer,这个只能去等mysql,redis是否准备好,还只能是在postStart里执行,在pod准备好的时间,先执行初始化脚本。

@stale stale bot added the wontfix This will not be worked on label Oct 15, 2019
@stale stale bot closed this Oct 16, 2019
@hhyo hhyo reopened this Oct 16, 2019
@stale stale bot removed the wontfix This will not be worked on label Oct 16, 2019
@hhyo hhyo added the enhancement New feature or request label Oct 16, 2019
Repository owner deleted a comment from stale bot Oct 16, 2019
@hhyo hhyo requested a review from LeoQuote November 2, 2019 07:19
Copy link
Collaborator

@LeoQuote LeoQuote left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

麻烦参考review进行修改

persistence:
enabled: false
# subchats mysql
mysql:
mysqlRootPassword: archery
mysqlDatabase: archery
persistence:
enabled: true
enabled: false
Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

请开启持久化

Copy link
Contributor Author

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
Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

麻烦增加一些ingress的配置吧。

Copy link
Contributor Author

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)
Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

这里可以考虑 exit(127) 之类的吗? exit 0会认为是正常退出。

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

目前暂时没有环境进行测试,当有已创建用户的异常时,应该是允许pod给正常ready,因没有分别捕捉出来,所以弄了一个0返回正常,这个到时候有环境了再修改。

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
enhancement New feature or request
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants