sealerio / sealer

Build, Share and Run Both Your Kubernetes Cluster and Distributed Applications (Project under CNCF)
http://sealer.cool
Apache License 2.0
2.06k stars 362 forks source link

Application config overwrite doesn't work with kube-installer image type #2297

Open JJGGu opened 1 year ago

JJGGu commented 1 year ago

What happen?

I use application api to overwrite my helm values.yaml,and use sealer apply command to deploy the cluster, but it does't work. I'm not sure if i use the application api incorrectly or it's a bug. Besides, I want to make sure the "overwrite" option means overwrite all content of specified file or overwrite the value of the key. image

Relevant log output?

No response

What you expected to happen?

No response

How to reproduce it (as minimally and precisely as possible)?

Sealer version: 0.9.3

Kubefile:
FROM ack-agility-registry.cn-shanghai.cr.aliyuncs.com/ecp_builder/ackdistro:v1-22-15-ack-10
APP nginx local://nginx/
LAUNCH ["nginx"]

Clusterfile:
apiVersion: sealer.io/v2
kind: Application
metadata:
  name: my-apps
spec:
  launchApps:
    - nginx
  configs:
    - name: nginx
      files:
        - path: values.yaml
          strategy: "overwrite"
          data: |
            replicaCount: 2
---
apiVersion: sealer.io/v2
kind: Cluster
metadata:
  name: my-cluster
spec:
  hosts:
    - ips:
        # input master ips, for example:
        # - 10.0.1.1
        # - 10.0.1.2
        - 192.168.0.203
      roles:
        - master
    - ips:
        # input worker ips, for example:
        # - 10.0.1.3
        # - 10.0.1.4
        - 192.168.0.202
      roles:
        - node
  image: localhost/image:v1
  ssh:
    # The master and worker password is same.
    passwd: asdf123-

Anything else we need to know?

No response

What is the version of Sealer you using?

0.9.3

What is your OS environment?

centos7.9

What is the Kernel version?

No response

Other environment you want to tell us?

starnop commented 1 year ago

please refer to http://sealer.cool/docs/concept/clusterfile.html#application-api

image

JJGGu commented 1 year ago

Tks, I have already read this document many times. I have also verified that the format of the Clusterfile matches the documentation. However, I am still unable to overwrite the target file after deployment. Can you please help me check if the issue lies with my Clusterfile or Kubefile, or if it is a bug in the system? @starnop

starnop commented 1 year ago

After testing, it only takes effect when the image is app-installer. Well, there should be a bug here that needs to be fixed