v1: Fix --state-values-set to override values of environments colocated with releases (#705)

This commit is contained in:
yxxhero
2023-03-05 16:03:00 +08:00
committed by GitHub
parent 522392c08c
commit 95c56d87fc
16 changed files with 364 additions and 37 deletions
@@ -0,0 +1 @@
ns: test1
@@ -0,0 +1,5 @@
chartifyTempDir: environment_overwrite_values
helmfileArgs:
- template
- --state-values-set
- ns=test3
@@ -0,0 +1,17 @@
environments:
default:
values:
- base.yaml
- override.yaml
repositories:
- name: bitnami
url: https://charts.bitnami.com/bitnami
releases:
- name: test
chart: bitnami/nginx
namespace: {{ .Values.ns }}
version: 13.2.27
values:
- values.yaml.gotmpl
@@ -0,0 +1,17 @@
environments:
default:
values:
- base.yaml
- override.yaml
---
repositories:
- name: bitnami
url: https://charts.bitnami.com/bitnami
releases:
- name: test
chart: bitnami/nginx
namespace: {{ .Values.ns }}
version: 13.2.27
values:
- values.yaml.gotmpl
@@ -0,0 +1,2 @@
image:
tag: {{ .Values.ns }}
@@ -0,0 +1,116 @@
Warning: environments and releases cannot be defined within the same YAML part. Use --- to extract the environments into a dedicated part
Warning: environments and releases cannot be defined within the same YAML part. Use --- to extract the environments into a dedicated part
Adding repo bitnami https://charts.bitnami.com/bitnami
"bitnami" has been added to your repositories
Templating release=test, chart=bitnami/nginx
---
# Source: nginx/templates/svc.yaml
apiVersion: v1
kind: Service
metadata:
name: test-nginx
namespace: "test3"
labels:
app.kubernetes.io/name: nginx
helm.sh/chart: nginx-13.2.27
app.kubernetes.io/instance: test
app.kubernetes.io/managed-by: Helm
annotations:
spec:
type: LoadBalancer
sessionAffinity: None
externalTrafficPolicy: "Cluster"
ports:
- name: http
port: 80
targetPort: http
selector:
app.kubernetes.io/name: nginx
app.kubernetes.io/instance: test
---
# Source: nginx/templates/deployment.yaml
apiVersion: apps/v1
kind: Deployment
metadata:
name: test-nginx
namespace: "test3"
labels:
app.kubernetes.io/name: nginx
helm.sh/chart: nginx-13.2.27
app.kubernetes.io/instance: test
app.kubernetes.io/managed-by: Helm
spec:
replicas: 1
strategy:
rollingUpdate: {}
type: RollingUpdate
selector:
matchLabels:
app.kubernetes.io/name: nginx
app.kubernetes.io/instance: test
template:
metadata:
labels:
app.kubernetes.io/name: nginx
helm.sh/chart: nginx-13.2.27
app.kubernetes.io/instance: test
app.kubernetes.io/managed-by: Helm
annotations:
spec:
automountServiceAccountToken: false
shareProcessNamespace: false
serviceAccountName: default
affinity:
podAffinity:
podAntiAffinity:
preferredDuringSchedulingIgnoredDuringExecution:
- podAffinityTerm:
labelSelector:
matchLabels:
app.kubernetes.io/name: nginx
app.kubernetes.io/instance: test
topologyKey: kubernetes.io/hostname
weight: 1
nodeAffinity:
hostNetwork: false
hostIPC: false
initContainers:
containers:
- name: nginx
image: docker.io/bitnami/nginx:test3
imagePullPolicy: "IfNotPresent"
env:
- name: BITNAMI_DEBUG
value: "false"
- name: NGINX_HTTP_PORT_NUMBER
value: "8080"
envFrom:
ports:
- name: http
containerPort: 8080
livenessProbe:
failureThreshold: 6
initialDelaySeconds: 30
periodSeconds: 10
successThreshold: 1
timeoutSeconds: 5
tcpSocket:
port: http
readinessProbe:
failureThreshold: 3
initialDelaySeconds: 5
periodSeconds: 5
successThreshold: 1
timeoutSeconds: 3
tcpSocket:
port: http
resources:
limits: {}
requests: {}
volumeMounts:
volumes:
@@ -0,0 +1,110 @@
---
# Source: nginx/templates/svc.yaml
apiVersion: v1
kind: Service
metadata:
name: test-nginx
namespace: "test3"
labels:
app.kubernetes.io/name: nginx
helm.sh/chart: nginx-13.2.27
app.kubernetes.io/instance: test
app.kubernetes.io/managed-by: Helm
annotations:
spec:
type: LoadBalancer
sessionAffinity: None
externalTrafficPolicy: "Cluster"
ports:
- name: http
port: 80
targetPort: http
selector:
app.kubernetes.io/name: nginx
app.kubernetes.io/instance: test
---
# Source: nginx/templates/deployment.yaml
apiVersion: apps/v1
kind: Deployment
metadata:
name: test-nginx
namespace: "test3"
labels:
app.kubernetes.io/name: nginx
helm.sh/chart: nginx-13.2.27
app.kubernetes.io/instance: test
app.kubernetes.io/managed-by: Helm
spec:
replicas: 1
strategy:
rollingUpdate: {}
type: RollingUpdate
selector:
matchLabels:
app.kubernetes.io/name: nginx
app.kubernetes.io/instance: test
template:
metadata:
labels:
app.kubernetes.io/name: nginx
helm.sh/chart: nginx-13.2.27
app.kubernetes.io/instance: test
app.kubernetes.io/managed-by: Helm
annotations:
spec:
automountServiceAccountToken: false
shareProcessNamespace: false
serviceAccountName: default
affinity:
podAffinity:
podAntiAffinity:
preferredDuringSchedulingIgnoredDuringExecution:
- podAffinityTerm:
labelSelector:
matchLabels:
app.kubernetes.io/name: nginx
app.kubernetes.io/instance: test
topologyKey: kubernetes.io/hostname
weight: 1
nodeAffinity:
hostNetwork: false
hostIPC: false
initContainers:
containers:
- name: nginx
image: docker.io/bitnami/nginx:test3
imagePullPolicy: "IfNotPresent"
env:
- name: BITNAMI_DEBUG
value: "false"
- name: NGINX_HTTP_PORT_NUMBER
value: "8080"
envFrom:
ports:
- name: http
containerPort: 8080
livenessProbe:
failureThreshold: 6
initialDelaySeconds: 30
periodSeconds: 10
successThreshold: 1
timeoutSeconds: 5
tcpSocket:
port: http
readinessProbe:
failureThreshold: 3
initialDelaySeconds: 5
periodSeconds: 5
successThreshold: 1
timeoutSeconds: 3
tcpSocket:
port: http
resources:
limits: {}
requests: {}
volumeMounts:
volumes:
@@ -0,0 +1 @@
https://github.com/helmfile/helmfile/issues/700