Skip to content
Toggle navigation
P
Projects
G
Groups
S
Snippets
Help
tingweiwang
/
ksyun-CICD-test
This project
Loading...
Sign in
Toggle navigation
Go to a project
Project
Repository
Issues
0
Merge Requests
0
Pipelines
Wiki
Snippets
Settings
Activity
Graph
Charts
Create a new issue
Jobs
Commits
Issue Boards
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Charts
Commit 1ae107c5
authored
May 06, 2020
by
tingweiwang
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
fix
1 parent
93bc8423
Show whitespace changes
Inline
Side-by-side
Showing
3 changed files
with
62 additions
and
7 deletions
deploy.sh
k8s_yaml/kpl-frontend.yaml → k8s_yaml/deployment.yaml
k8s_yaml/kpl-frontend-svc.yaml → k8s_yaml/svc.yaml
deploy.sh
View file @
1ae107c
#!/bin/bash
#!/bin/bash
#wangtingwei
#wangtingwei
image_list
=(
dev_host
=
192.168.1.42
192.168.1.32:5000/k8s/nginx:latest
fu_host
=
192.168.1.36
)
test_host
=
192.168.51
IMAGE
=
hub.kce.ksyun.com/kpl_k8s/nginx:latest
DOCKER_REGISTRY
=
hub.kce.ksyun.com
#########################################
sed_yaml
()
{
echo
"修改image名字"
sed -i s@DOCKER_REGISTRY@
$DOCKER_REGISTRY
@g
sed -i s@IMAGE@
$IMAGE
@g
}
################################
recover_yaml
()
{
echo
"恢复yaml模板"
sed -i s@
$DOCKER_REGISTRY
@hub.kce.ksyun.com@g
sed -i s@
$IMAGE
@nginx:latestg
}
###################################
delt_all
()
{
kubectl delete -f k8s_yaml
}
############################################
create_all
()
{
kubectl apply -f k8s_yaml
}
##########################################
deploy_test
()
{
pwd
}
:<<!
if
[[
$DEPLOY_ENV
=
"dev"
]]
then
echo
"当前部署环境是开发环境"
elif
[[
$DEPLOY_ENV
=
"test"
]]
then
echo
"当前部署环境是测试环境"
else
echo
"你没有选择环境 && exit 111"
fi
!
case
$1
in
test
)
deploy_test
;;
dev
)
deploy_dev
;;
*
)
echo
"please input (test|dev)"
esac
k8s_yaml/
kpl-frontend
.yaml
→
k8s_yaml/
deployment
.yaml
View file @
1ae107c
...
@@ -2,7 +2,7 @@ apiVersion: extensions/v1beta1
...
@@ -2,7 +2,7 @@ apiVersion: extensions/v1beta1
kind
:
Deployment
kind
:
Deployment
metadata
:
metadata
:
name
:
CICD--frontend
name
:
CICD--frontend
namespace
:
kpl
namespace
:
test
spec
:
spec
:
replicas
:
1
replicas
:
1
template
:
template
:
...
@@ -13,8 +13,8 @@ spec:
...
@@ -13,8 +13,8 @@ spec:
nodeSelector
:
nodeSelector
:
internal_service_node
:
"
true"
internal_service_node
:
"
true"
containers
:
containers
:
-
name
:
kpl
--frontend
-
name
:
CICD
--frontend
image
:
DOCKER_REGISTRY/kpl--frontend:latest
image
:
$DOCKER_REGISTRY/$IMAGE
imagePullPolicy
:
Always
imagePullPolicy
:
Always
ports
:
ports
:
-
containerPort
:
80
-
containerPort
:
80
...
...
k8s_yaml/
kpl-frontend-
svc.yaml
→
k8s_yaml/svc.yaml
View file @
1ae107c
...
@@ -2,7 +2,7 @@ apiVersion: v1
...
@@ -2,7 +2,7 @@ apiVersion: v1
kind
:
Service
kind
:
Service
metadata
:
metadata
:
name
:
CICD--frontend
name
:
CICD--frontend
namespace
:
kpl
namespace
:
test
spec
:
spec
:
type
:
NodePort
type
:
NodePort
selector
:
selector
:
...
...
Write
Preview
Markdown
is supported
Attach a file
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to post a comment