update
This commit is contained in:
@@ -1,3 +1,4 @@
|
||||
# base64 -w 0 ~/kube.config
|
||||
apiVersion: v1
|
||||
clusters:
|
||||
- cluster:
|
||||
@@ -8,9 +9,6 @@ clusters:
|
||||
insecure-skip-tls-verify: true
|
||||
server: https://kevisual.cn:6443
|
||||
name: kevisual-cluster
|
||||
- cluster:
|
||||
server: ""
|
||||
name: kevisual-context
|
||||
contexts:
|
||||
- context:
|
||||
cluster: dev-cluster
|
||||
|
||||
@@ -1,3 +1,17 @@
|
||||
# 安装kubectl
|
||||
|
||||
```sh
|
||||
curl -LO "https://dl.k8s.io/release/$(curl -L -s https://dl.k8s.io/release/stable.txt)/bin/linux/amd64/kubectl"
|
||||
chmod +x kubectl
|
||||
sudo mv kubectl /usr/local/bin/kubectl
|
||||
kubectl version --client
|
||||
```
|
||||
配置自动补全
|
||||
```sh
|
||||
source <(kubectl completion bash) # 临时生效
|
||||
echo "source <(kubectl completion bash)" >> ~/.bashrc # 永久生效
|
||||
```
|
||||
|
||||
# 设置默认 context
|
||||
```sh
|
||||
kubectl config use-context <context-name>
|
||||
|
||||
76
k8s/xiongxiao.me/apps/blog/app.yaml
Normal file
76
k8s/xiongxiao.me/apps/blog/app.yaml
Normal file
@@ -0,0 +1,76 @@
|
||||
apiVersion: apps/v1
|
||||
kind: Deployment
|
||||
metadata:
|
||||
name: blog
|
||||
labels:
|
||||
app: blog
|
||||
spec:
|
||||
replicas: 1
|
||||
selector:
|
||||
matchLabels:
|
||||
app: blog
|
||||
template:
|
||||
metadata:
|
||||
labels:
|
||||
app: blog
|
||||
spec:
|
||||
containers:
|
||||
- name: blog
|
||||
image: docker.cnb.cool/abearxiong/blog:latest
|
||||
ports:
|
||||
- containerPort: 80
|
||||
resources:
|
||||
requests:
|
||||
memory: "64Mi"
|
||||
cpu: "50m"
|
||||
limits:
|
||||
memory: "256Mi"
|
||||
cpu: "200m"
|
||||
livenessProbe:
|
||||
httpGet:
|
||||
path: /
|
||||
port: 80
|
||||
initialDelaySeconds: 10
|
||||
periodSeconds: 10
|
||||
timeoutSeconds: 5
|
||||
failureThreshold: 3
|
||||
readinessProbe:
|
||||
httpGet:
|
||||
path: /
|
||||
port: 80
|
||||
initialDelaySeconds: 5
|
||||
periodSeconds: 5
|
||||
timeoutSeconds: 3
|
||||
failureThreshold: 3
|
||||
---
|
||||
apiVersion: v1
|
||||
kind: Service
|
||||
metadata:
|
||||
name: blog
|
||||
labels:
|
||||
app: blog
|
||||
spec:
|
||||
type: ClusterIP
|
||||
ports:
|
||||
- port: 80
|
||||
targetPort: 80
|
||||
protocol: TCP
|
||||
name: http
|
||||
selector:
|
||||
app: blog
|
||||
---
|
||||
apiVersion: traefik.io/v1alpha1
|
||||
kind: IngressRoute
|
||||
metadata:
|
||||
name: blog-https
|
||||
spec:
|
||||
entryPoints:
|
||||
- websecure
|
||||
routes:
|
||||
- match: Host(`blog.xiongxiao.me`)
|
||||
kind: Rule
|
||||
services:
|
||||
- name: blog
|
||||
port: 80
|
||||
tls:
|
||||
certResolver: letsencrypt
|
||||
7
k8s/xiongxiao.me/apps/blog/compose.yml
Normal file
7
k8s/xiongxiao.me/apps/blog/compose.yml
Normal file
@@ -0,0 +1,7 @@
|
||||
services:
|
||||
blog:
|
||||
image: docker.cnb.cool/abearxiong/blog:latest
|
||||
container_name: blog
|
||||
restart: unless-stopped
|
||||
ports:
|
||||
- "80:80"
|
||||
4
k8s/xiongxiao.me/apps/blog/log.sh
Normal file
4
k8s/xiongxiao.me/apps/blog/log.sh
Normal file
@@ -0,0 +1,4 @@
|
||||
# kubectl logs openlist-869ffbc74f-kjmbs
|
||||
|
||||
# uplate
|
||||
kubectl rollout restart deployment blog
|
||||
Reference in New Issue
Block a user