-
Notifications
You must be signed in to change notification settings - Fork 101
参赛项目-web系统 #80
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
Open
zkesong
wants to merge
8
commits into
cloudnativeapp:master
Choose a base branch
from
zkesong:master
base: master
Could not load branches
Branch not found: {{ refName }}
Loading
Could not load tags
Nothing to show
Loading
Are you sure you want to change the base?
Some commits from the old base branch may be removed from the timeline,
and old review comments may become outdated.
Open
参赛项目-web系统 #80
Changes from all commits
Commits
Show all changes
8 commits
Select commit
Hold shift + click to select a range
ee513bb
Create Readme
zkesong cd1de93
Update and rename Readme to README.md
zkesong 4a36265
Add files via upload
zkesong aad511d
Create t
zkesong d5ec623
Add files via upload
zkesong 52d9034
Delete t
zkesong 65949f5
Update README.md
zkesong 3c35626
Update README.md
zkesong File filter
Filter by extension
Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
There are no files selected for viewing
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,22 @@ | ||
| # Patterns to ignore when building packages. | ||
| # This supports shell glob matching, relative path matching, and | ||
| # negation (prefixed with !). Only one pattern per line. | ||
| .DS_Store | ||
| # Common VCS dirs | ||
| .git/ | ||
| .gitignore | ||
| .bzr/ | ||
| .bzrignore | ||
| .hg/ | ||
| .hgignore | ||
| .svn/ | ||
| # Common backup files | ||
| *.swp | ||
| *.bak | ||
| *.tmp | ||
| *~ | ||
| # Various IDEs | ||
| .project | ||
| .idea/ | ||
| *.tmproj | ||
| .vscode/ |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,5 @@ | ||
| apiVersion: v1 | ||
| appVersion: "1.0" | ||
| description: A Helm chart for Kubernetes app mobile-number-admin chart | ||
| name: mobile-number-admin | ||
| version: 0.0.1 | ||
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,59 @@ | ||
| # mobile-number-admin | ||
|
|
||
| ## 功能介绍 | ||
|
|
||
| 提供一个手机号码登记管理信息系统,可以根据必需的数据库表格创建出自己的web管理系统 | ||
|
|
||
| ## 安装使用 | ||
|
|
||
| ```shell | ||
| helm install mobile-number-admin | ||
| ``` | ||
|
|
||
| or | ||
|
|
||
| //helm v3 | ||
| ```shell | ||
| helm install mobile-number-admin --generate-name | ||
| ``` | ||
| 运行后看到输出: | ||
|
|
||
| ```shell | ||
| NAME: iced-abalone | ||
| LAST DEPLOYED: Fri Aug 23 11:09:50 2019 | ||
| NAMESPACE: default | ||
| STATUS: DEPLOYED | ||
|
|
||
| RESOURCES: | ||
| ==> v1/Deployment | ||
| NAME READY UP-TO-DATE AVAILABLE AGE | ||
| iced-abalone-mobile-number-admin 0/2 0 0 0s | ||
|
Member
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. 这里的ready 一直是0/2,我这边验证也是如此,port-forward以后也不能访问。 |
||
|
|
||
| ==> v1/Service | ||
| NAME TYPE CLUSTER-IP EXTERNAL-IP PORT(S) AGE | ||
| iced-abalone-mobile-number-admin ClusterIP 10.0.0.235 <none> 80/TCP 0s | ||
|
|
||
|
|
||
| NOTES: | ||
| 1. Get the application URL by running these commands: | ||
| export POD_NAME=$(kubectl get pods --namespace default -l "app.kubernetes.io/name=mobile-number-admin,app.kubernetes.io/instance=iced-abalone" -o jsonpath="{.items[0].metadata.name}") | ||
| echo "Visit http://127.0.0.1:8080 to use your application" | ||
| kubectl port-forward $POD_NAME 8080:80 | ||
| ``` | ||
| Web登录界面如下所示: | ||
|  | ||
| Web登录管理界面如下: | ||
|  | ||
|
|
||
| ## 其它说明 | ||
|
|
||
| 需要更改数据库等配置,请参考:https://github.com/zkesong/mobile-number-admin | ||
|
|
||
| # 安装 | ||
| Add repository | ||
| ```shell | ||
| helm repo add apphub https://apphub.aliyuncs.com/ | ||
| ``` | ||
| Insatll chart | ||
| ```shell | ||
| helm install apphub/mobile-number-admin --version v1.0 | ||
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,21 @@ | ||
| 1. Get the application URL by running these commands: | ||
| {{- if .Values.ingress.enabled }} | ||
| {{- range $host := .Values.ingress.hosts }} | ||
| {{- range .paths }} | ||
| http{{ if $.Values.ingress.tls }}s{{ end }}://{{ $host.host }}{{ . }} | ||
| {{- end }} | ||
| {{- end }} | ||
| {{- else if contains "NodePort" .Values.service.type }} | ||
| export NODE_PORT=$(kubectl get --namespace {{ .Release.Namespace }} -o jsonpath="{.spec.ports[0].nodePort}" services {{ include "mobile-number-admin.fullname" . }}) | ||
| export NODE_IP=$(kubectl get nodes --namespace {{ .Release.Namespace }} -o jsonpath="{.items[0].status.addresses[0].address}") | ||
| echo http://$NODE_IP:$NODE_PORT | ||
| {{- else if contains "LoadBalancer" .Values.service.type }} | ||
| NOTE: It may take a few minutes for the LoadBalancer IP to be available. | ||
| You can watch the status of by running 'kubectl get --namespace {{ .Release.Namespace }} svc -w {{ include "mobile-number-admin.fullname" . }}' | ||
| export SERVICE_IP=$(kubectl get svc --namespace {{ .Release.Namespace }} {{ include "mobile-number-admin.fullname" . }} -o jsonpath='{.status.loadBalancer.ingress[0].ip}') | ||
| echo http://$SERVICE_IP:{{ .Values.service.port }} | ||
| {{- else if contains "ClusterIP" .Values.service.type }} | ||
| export POD_NAME=$(kubectl get pods --namespace {{ .Release.Namespace }} -l "app.kubernetes.io/name={{ include "mobile-number-admin.name" . }},app.kubernetes.io/instance={{ .Release.Name }}" -o jsonpath="{.items[0].metadata.name}") | ||
| echo "Visit http://127.0.0.1:8080 to use your application" | ||
| kubectl port-forward $POD_NAME 8080:80 | ||
| {{- end }} |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,45 @@ | ||
| {{/* vim: set filetype=mustache: */}} | ||
| {{/* | ||
| Expand the name of the chart. | ||
| */}} | ||
| {{- define "mobile-number-admin.name" -}} | ||
| {{- default .Chart.Name .Values.nameOverride | trunc 63 | trimSuffix "-" -}} | ||
| {{- end -}} | ||
|
|
||
| {{/* | ||
| Create a default fully qualified app name. | ||
| We truncate at 63 chars because some Kubernetes name fields are limited to this (by the DNS naming spec). | ||
| If release name contains chart name it will be used as a full name. | ||
| */}} | ||
| {{- define "mobile-number-admin.fullname" -}} | ||
| {{- if .Values.fullnameOverride -}} | ||
| {{- .Values.fullnameOverride | trunc 63 | trimSuffix "-" -}} | ||
| {{- else -}} | ||
| {{- $name := default .Chart.Name .Values.nameOverride -}} | ||
| {{- if contains $name .Release.Name -}} | ||
| {{- .Release.Name | trunc 63 | trimSuffix "-" -}} | ||
| {{- else -}} | ||
| {{- printf "%s-%s" .Release.Name $name | trunc 63 | trimSuffix "-" -}} | ||
| {{- end -}} | ||
| {{- end -}} | ||
| {{- end -}} | ||
|
|
||
| {{/* | ||
| Create chart name and version as used by the chart label. | ||
| */}} | ||
| {{- define "mobile-number-admin.chart" -}} | ||
| {{- printf "%s-%s" .Chart.Name .Chart.Version | replace "+" "_" | trunc 63 | trimSuffix "-" -}} | ||
| {{- end -}} | ||
|
|
||
| {{/* | ||
| Common labels | ||
| */}} | ||
| {{- define "mobile-number-admin.labels" -}} | ||
| app.kubernetes.io/name: {{ include "mobile-number-admin.name" . }} | ||
| helm.sh/chart: {{ include "mobile-number-admin.chart" . }} | ||
| app.kubernetes.io/instance: {{ .Release.Name }} | ||
| {{- if .Chart.AppVersion }} | ||
| app.kubernetes.io/version: {{ .Chart.AppVersion | quote }} | ||
| {{- end }} | ||
| app.kubernetes.io/managed-by: {{ .Release.Service }} | ||
| {{- end -}} |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,52 @@ | ||
| apiVersion: apps/v1 | ||
| kind: Deployment | ||
| metadata: | ||
| name: {{ include "mobile-number-admin.fullname" . }} | ||
| labels: | ||
| {{ include "mobile-number-admin.labels" . | indent 4 }} | ||
| spec: | ||
| replicas: {{ .Values.replicaCount }} | ||
| selector: | ||
| matchLabels: | ||
| app.kubernetes.io/name: {{ include "mobile-number-admin.name" . }} | ||
| app.kubernetes.io/instance: {{ .Release.Name }} | ||
| template: | ||
| metadata: | ||
| labels: | ||
| app.kubernetes.io/name: {{ include "mobile-number-admin.name" . }} | ||
| app.kubernetes.io/instance: {{ .Release.Name }} | ||
| spec: | ||
| {{- with .Values.imagePullSecrets }} | ||
| imagePullSecrets: | ||
| {{- toYaml . | nindent 8 }} | ||
| {{- end }} | ||
| containers: | ||
| - name: {{ .Chart.Name }} | ||
| image: "{{ .Values.image.repository }}:{{ .Values.image.tag }}" | ||
| imagePullPolicy: {{ .Values.image.pullPolicy }} | ||
| ports: | ||
| - name: http | ||
| containerPort: 80 | ||
| protocol: TCP | ||
| livenessProbe: | ||
| httpGet: | ||
| path: / | ||
| port: http | ||
| readinessProbe: | ||
| httpGet: | ||
| path: / | ||
| port: http | ||
| resources: | ||
| {{- toYaml .Values.resources | nindent 12 }} | ||
| {{- with .Values.nodeSelector }} | ||
| nodeSelector: | ||
| {{- toYaml . | nindent 8 }} | ||
| {{- end }} | ||
| {{- with .Values.affinity }} | ||
| affinity: | ||
| {{- toYaml . | nindent 8 }} | ||
| {{- end }} | ||
| {{- with .Values.tolerations }} | ||
| tolerations: | ||
| {{- toYaml . | nindent 8 }} | ||
| {{- end }} |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,36 @@ | ||
| {{- if .Values.ingress.enabled -}} | ||
| {{- $fullName := include "mobile-number-admin.fullname" . -}} | ||
| apiVersion: extensions/v1beta1 | ||
| kind: Ingress | ||
| metadata: | ||
| name: {{ $fullName }} | ||
| labels: | ||
| {{ include "mobile-number-admin.labels" . | indent 4 }} | ||
| {{- with .Values.ingress.annotations }} | ||
| annotations: | ||
| {{- toYaml . | nindent 4 }} | ||
| {{- end }} | ||
| spec: | ||
| {{- if .Values.ingress.tls }} | ||
| tls: | ||
| {{- range .Values.ingress.tls }} | ||
| - hosts: | ||
| {{- range .hosts }} | ||
| - {{ . | quote }} | ||
| {{- end }} | ||
| secretName: {{ .secretName }} | ||
| {{- end }} | ||
| {{- end }} | ||
| rules: | ||
| {{- range .Values.ingress.hosts }} | ||
| - host: {{ .host | quote }} | ||
| http: | ||
| paths: | ||
| {{- range .paths }} | ||
| - path: {{ . }} | ||
| backend: | ||
| serviceName: {{ $fullName }} | ||
| servicePort: http | ||
| {{- end }} | ||
| {{- end }} | ||
| {{- end }} |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,16 @@ | ||
| apiVersion: v1 | ||
| kind: Service | ||
| metadata: | ||
| name: {{ include "mobile-number-admin.fullname" . }} | ||
| labels: | ||
| {{ include "mobile-number-admin.labels" . | indent 4 }} | ||
| spec: | ||
| type: {{ .Values.service.type }} | ||
| ports: | ||
| - port: {{ .Values.service.port }} | ||
| targetPort: http | ||
| protocol: TCP | ||
| name: http | ||
| selector: | ||
| app.kubernetes.io/name: {{ include "mobile-number-admin.name" . }} | ||
| app.kubernetes.io/instance: {{ .Release.Name }} |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,51 @@ | ||
| # Default values for mobile-number-admin. | ||
| # This is a YAML-formatted file. | ||
| # Declare variables to be passed into your templates. | ||
|
|
||
| replicaCount: 2 | ||
|
|
||
| image: | ||
| repository: registry.cn-shanghai.aliyuncs.com/docker-zks/mobile-number-admin | ||
| tag: v1.0 | ||
| pullPolicy: IfNotPresent | ||
|
|
||
| imagePullSecrets: [] | ||
| nameOverride: "" | ||
| fullnameOverride: "" | ||
|
|
||
| service: | ||
| type: ClusterIP | ||
| port: 80 | ||
| targetPort: 80 | ||
|
|
||
| ingress: | ||
| enabled: false | ||
| annotations: {} | ||
| # kubernetes.io/ingress.class: nginx | ||
| # kubernetes.io/tls-acme: "true" | ||
| hosts: | ||
| - host: chart-example.local | ||
| paths: [] | ||
|
|
||
| tls: [] | ||
| # - secretName: chart-example-tls | ||
| # hosts: | ||
| # - chart-example.local | ||
|
|
||
| resources: | ||
| # We usually recommend not to specify default resources and to leave this as a conscious | ||
| # choice for the user. This also increases chances charts run on environments with little | ||
| # resources, such as Minikube. If you do want to specify resources, uncomment the following | ||
| # lines, adjust them as necessary, and remove the curly braces after 'resources:'. | ||
| limits: | ||
| cpu: 100m | ||
| memory: 128Mi | ||
| requests: | ||
| cpu: 100m | ||
| memory: 128Mi | ||
|
|
||
| nodeSelector: {} | ||
|
|
||
| tolerations: [] | ||
|
|
||
| affinity: {} |
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
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.
加上maintainer信息