标签:arc des pos -bash adb get ase container strategy
wget https://get.helm.sh/helm-v3.0.0-linux-amd64.tar.gz
tar zxvf helm-v3.0.0-linux-amd64.tar.gz
mv linux-amd64/helm /usr/bin/
helm repo add stable http://mirror.azure.cn/kubernetes/charts
helm repo add aliyun https://kubernetes.oss-cn-hangzhou.aliyuncs.com/charts
helm repo update
helm repo list
helm search repo stable
helm repo remove aliyun
helm create nginx
cd nginx/
├── charts
├── Chart.yaml # 可以被templates下面的文件引用
├── templates
│?? ├── deployment.yaml
│?? ├── _helpers.tpl
│?? ├── ingress.yaml
│?? ├── NOTES.txt
│?? ├── serviceaccount.yaml
│?? ├── service.yaml
│?? └── tests
│?? └── test-connection.yaml
└── values.yaml # 定义变量, 可以被templates下面的文件引用
rm -rf /root/nginx/templates/*
kubectl create deployment web --image=nginx --dry-run -o yaml>/root/nginx/templates/deployment.yaml
kubectl apply -f /root/nginx/templates/deployment.yaml
kubectl expose deployment web --port=80 --target-port=80 --dry-run -o yaml > service.yaml
apiVersion: apps/v1
kind: Deployment
metadata:
creationTimestamp: null
labels:
app: web
name: web
spec:
replicas: 1
selector:
matchLabels:
app: web
strategy: {}
template:
metadata:
creationTimestamp: null
labels:
app: web
spec:
containers:
- image: nginx
name: nginx
resources: {}
status: {}
apiVersion: v1
kind: Service
metadata:
creationTimestamp: null
labels:
app: web
name: web
spec:
ports:
- port: 80
protocol: TCP
targetPort: 80
selector:
app: web
status:
loadBalancer: {}
kubectl get pods
kubectl get svc
kubectl delete -f /root/nginx/templates/
kubectl delete -f /root/nginx/
helm install web /root/nginx/
helm ls
Release.Name | release 名称 |
---|---|
Release.Name | helm install时候 的 release 名字 |
Release.Namespace | release 命名空间 |
Release.Service | release 服务的名称 |
Release.Revision | release 修订版本号,从1开始累加 |
apiVersion: apps/v1
kind: Deployment
metadata:
labels:
chart: {{ .Chart.Name }}
app: {{ .Release.Name }}
name: {{ .Release.Name }}
spec:
replicas: {{ .Values.replicas }}
selector:
matchLabels:
app: {{ .Values.label }}
template:
metadata:
labels:
app: {{ .Values.label }}
spec:
containers:
- image: {{ .Values.image }}:{{ .Values.imageTag}}
name: {{ .Release.Name }}
resources: {}
status: {}
apiVersion: v1
kind: Service
metadata:
labels:
chart: {{ .Chart.Name }}
app: {{ .Release.Name }}
name: {{ .Release.Name }}
spec:
ports:
- port: {{ .Values.port }}
protocol: TCP
targetPort: {{ .Values.targetPort }}
selector:
app: {{ .Values.label }}
replicas: 3
image: nginx
imageTag: 1.17
label: nginx_label
port: 80
targetPort: 80
apiVersion: v2
name: nginx
description: A Helm chart for Kubernetes
type: application
version: 0.1.0
appVersion: 1.16.0
helm install lyysb /root/nginx/
helm upgrade lyysb /root/nginx/
helm delete lyysb
标签:arc des pos -bash adb get ase container strategy
原文地址:https://www.cnblogs.com/cjwnb/p/12571199.html