Skip to content

helm模板

基本模板-myapp

bash
helm create myapp

templates/nodePort.yaml

yaml
apiVersion: v1
kind: Service
metadata:
  labels:
    app: myapp-test
  name: myapp-test-20250118-svc
spec:
  ports:
    - name: 80-80
      port: 80
      protocol: TCP
      targetPort: 80
      nodePort: 33222
  selector:
    app: myapp-test
  type: NodePort

templates/deployment.yaml

yaml
apiVersion: apps/v1
kind: Deployment
metadata:
  labels:
    app: myapp-test
  name: myapp-test-20250118-deploy
spec:
  replicas: 5
  selector:
    matchLabels:
      app: myapp-test
  template:
    metadata:
      labels:
        app: myapp-test
    spec:
      containers:
        - image: nginx:1.27.2
          name: myapp