-
Notifications
You must be signed in to change notification settings - Fork 108
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Merge pull request #1120 from praveenrewar/update-package-values
Expose values in kapp-controller package
- Loading branch information
Showing
19 changed files
with
243 additions
and
29 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
File renamed without changes.
File renamed without changes.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,14 @@ | ||
#@ load("@ytt:overlay", "overlay") | ||
#@ load("@ytt:data", "data") | ||
|
||
#@overlay/match by=overlay.subset({"kind":"Deployment","metadata":{"name": "kapp-controller"}}) | ||
#@overlay/insert before=True | ||
--- | ||
#! This optional Secret must be created before the kapp-controller pod launches in order to read it. | ||
apiVersion: v1 | ||
kind: Secret | ||
metadata: | ||
#! Name must be `kapp-controller-config` for kapp controller to pick it up | ||
name: kapp-controller-config | ||
namespace: #@ data.values.namespace | ||
stringData: #@ data.values.config |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,9 @@ | ||
#@ load("@ytt:overlay", "overlay") | ||
#@ load("@ytt:data", "data") | ||
|
||
#@overlay/match by=overlay.subset({"metadata":{"name":"packagerepositories.packaging.carvel.dev"}}) | ||
--- | ||
metadata: | ||
#@overlay/match missing_ok=True | ||
annotations: | ||
packaging.carvel.dev/global-namespace: #@ data.values.packagingGlobalNamespace |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,69 @@ | ||
#@ load("@ytt:overlay", "overlay") | ||
#@ load("@ytt:data", "data") | ||
#@ load("@ytt:yaml", "yaml") | ||
|
||
#@ def is_toleration_specified(toleration): | ||
#@ return toleration in yaml.decode(yaml.encode(data.values.tolerations)) | ||
#@ end | ||
|
||
#@ default_tolerations = [] | ||
#@ is_primary_specified = is_toleration_specified({"effect":"NoSchedule", "key":"node-role.kubernetes.io/master"}) | ||
#@ is_control_specified = is_toleration_specified({"effect":"NoSchedule", "key":"node-role.kubernetes.io/control-plane"}) | ||
|
||
#@ if is_primary_specified and not is_control_specified: | ||
#@ default_tolerations += [{"effect":"NoSchedule", "key":"node-role.kubernetes.io/control-plane"}] | ||
#@ end | ||
|
||
#@overlay/match by=overlay.subset({"kind":"Deployment","metadata":{"name": "kapp-controller"}}) | ||
--- | ||
spec: | ||
template: | ||
#@overlay/match-child-defaults missing_ok=True | ||
spec: | ||
containers: | ||
#@overlay/match by=overlay.subset({"name":"kapp-controller"}) | ||
- args: | ||
#@overlay/append | ||
- #@ "-concurrency={}".format(data.values.concurrency) | ||
#@overlay/append | ||
- #@ "-metrics-bind-address={}".format(data.values.metricsBindAddress) | ||
|
||
#@overlay/match by=overlay.subset({"name":"kapp-controller-sidecarexec"}) | ||
- | ||
#@ if/end data.values.coreDNSIP: | ||
volumeMounts: | ||
- mountPath: /etc | ||
name: etc | ||
|
||
#@ if data.values.coreDNSIP: | ||
#! Using init container bypasses the restriction of not having root access in main container | ||
#! It modifies /etc/resolv.conf which is shared to main container | ||
initContainers: | ||
- args: | ||
- -c | ||
- #@ "cp /etc/resolv.conf /etc/resolv.conf.bak; sed '1 i nameserver " + data.values.coreDNSIP + "' /etc/resolv.conf.bak > /etc/resolv.conf; rm /etc/resolv.conf.bak; cp -R /etc/* /kapp-etc; chmod g+w /kapp-etc/pki/tls/certs/" | ||
command: | ||
- /bin/sh | ||
image: kapp-controller | ||
name: init-kapp-controller | ||
securityContext: | ||
allowPrivilegeEscalation: false | ||
runAsUser: 0 | ||
volumeMounts: | ||
- mountPath: /kapp-etc | ||
name: etc | ||
#@ end | ||
#@ if/end data.values.hostNetwork: | ||
hostNetwork: #@ data.values.hostNetwork | ||
#@ if/end data.values.priorityClassName: | ||
priorityClassName: #@ data.values.priorityClassName | ||
#@ if hasattr(data.values, 'tolerations') and data.values.tolerations: | ||
tolerations: #@ default_tolerations + data.values.tolerations | ||
#@ end | ||
#@ if data.values.coreDNSIP: | ||
volumes: | ||
#@overlay/append | ||
- emptyDir: | ||
medium: Memory | ||
name: etc | ||
#@ end |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,63 @@ | ||
#@ load("@ytt:overlay", "overlay") | ||
#@ load("@ytt:data", "data") | ||
|
||
#@ def matcher(): | ||
kind: Deployment | ||
metadata: | ||
name: kapp-controller | ||
spec: | ||
template: | ||
spec: | ||
nodeSelector: | ||
node-role.kubernetes.io/master: "" | ||
#@ end | ||
|
||
#@overlay/match expects="0+",by=overlay.subset({"kind":"Deployment"}) | ||
--- | ||
kind: Deployment | ||
spec: | ||
#@ if data.values.deployment.updateStrategy: | ||
#@overlay/match missing_ok=True | ||
strategy: | ||
type: #@ data.values.deployment.updateStrategy | ||
#@overlay/match missing_ok=True | ||
#@ if data.values.deployment.updateStrategy == "RollingUpdate": | ||
rollingUpdate: | ||
#@ if/end data.values.deployment.rollingUpdate.maxUnavailable != None: | ||
maxUnavailable: #@ data.values.deployment.rollingUpdate.maxUnavailable | ||
#@ if/end data.values.deployment.rollingUpdate.maxSurge != None: | ||
maxSurge: #@ data.values.deployment.rollingUpdate.maxSurge | ||
#@ end | ||
#@ end | ||
#@ if data.values.nodeSelector != None: | ||
template: | ||
spec: | ||
#@overlay/match missing_ok=True | ||
nodeSelector: | ||
#@ for key in data.values.nodeSelector: | ||
#@overlay/match missing_ok=True | ||
#@yaml/text-templated-strings | ||
(@= key @): #@ data.values.nodeSelector[key] | ||
#@ end | ||
#@ end | ||
|
||
#@overlay/match expects="0+",by=overlay.subset({"kind":"DaemonSet"}) | ||
--- | ||
kind: DaemonSet | ||
spec: | ||
#@ if data.values.daemonset.updateStrategy: | ||
#@overlay/match missing_ok=True | ||
updateStrategy: | ||
type: #@ data.values.daemonset.updateStrategy | ||
#@ end | ||
|
||
#@overlay/match by=overlay.subset(matcher()) , when=1 | ||
--- | ||
spec: | ||
template: | ||
spec: | ||
nodeSelector: | ||
#@overlay/remove | ||
node-role.kubernetes.io/master: | ||
#@overlay/match missing_ok=True | ||
node-role.kubernetes.io/control-plane: "" |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters