GV

GeezerVison

The World Wide Web, restored to 800 pixels of glory.

Home|About|Gaming cabinet|Archives|How it works|Starter sites

On this site

  • Sign in
  • ActionsCI/CD and automation
  • CodespacesCloud development environments
  • All Features
  • Documentation
  • Training
  • Certifications
  • Build with Copilot
  • Customize Copilot
  • Integrations
  • Trending repos
  • GitHub Sponsors
  • Developer articles
  • Enterprises

This view

  • Original page
  • New address

GeezerVison is showing github.com — GitHub - costa92/k8s-apply: k8s use yaml

BranchesTags
Open more actions menu

Latest commit

 

History

57 Commits
57 Commits

Folders and files

NameName
Last commit message
Last commit date
argoCd
argoCd
 
 
deployment
deployment
 
 
dtm
dtm
 
 
gateway
gateway
 
 
helm
helm
 
 
ingress
ingress
 
 
kustomize/helloworld
kustomize/helloworld
 
 
lean-basic
lean-basic
 
 
mysql
mysql
 
 
nginx
nginx
 
 
rabbitmq
rabbitmq
 
 
ratel
ratel
 
 
redis
redis
 
 
sample
sample
 
 
traefik
traefik
 
 
.gitignore
.gitignore
 
 
README.md
README.md
 
 
ingress-nginx.yaml
ingress-nginx.yaml
 
 

Repository files navigation

k8s apply desc

安装 k8s 服务

安装 ingress 服务

kubectl apply -f ingress-nginx.yaml

参考使用: ingress

安装服务

dtm 安装

kubectl apply -f dtm/deployment.yml -f dtm/configMap.yml -f dtm/service.yml

安装 dtm 的 ingress

kubectl apply -f ingress/ingress-nginx.yaml

修改 /etc/hosts 添加

hello-jane.test  192.168.11.10

注意: hello-jane.test 是自己定义的域名, 192.168.11.10 是节点的 ip

参考项目地址:GitHub

参考文档: Docs

mysql-endpoint

mysql 一般不会安装到 k8s 集群中,因此需要通过 endpoint 连接外部服务,

// 安装 endpoint
kubectl apply -f mysql-endpoint.yaml
// 安装服务
kubectl apply -f mysql-service.yaml

参考自定义服务文档: 定义 Service

nginx 服务

kubectl apply -f nginx-deployment.yaml
kubectl apply -f service.yml

测试

参考 sample文件中的 apple.yaml、banana.yaml、ingress.yaml

注意: 在 mac docker 中容器 hostPort 参数不能生效

    ports:
    - name: web
        containerPort: 80
        hostPort: 80  # 不能生效 mac docker 中
        protocol: TCP

原因参考: [Docker 的(Linux/Mac OS)网络配置问题] (https://yuanmomo.net/2019/06/13/docker-network/)

宿主机访问容器,使用 -p 参数映射端口。容器访问宿主机,可以在宿主机使用下面的命令获取 宿主机的 ip 地址:

ps -ef | grep -i docker | grep -i  "\-\-host\-ip" |awk -F "host-ip" '{print $2}' | awk -F '--lowest-ip' '{print $1}'

About

k8s use yaml

Resources

Readme
Activity

Stars

1 star

Watchers

1 watching

Forks

0 forks
Report repository

Releases

Packages

Used by

Contributors

Languages

You are visitor 01402792 — GeezerVison does not store the pages you look up.
Best viewed with Netscape Navigator 4.7 or Internet Explorer 6 at 800×600. No cookies required.