-
Notifications
You must be signed in to change notification settings - Fork 140
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
feat: support dnsPolicy and dnsConfig for all components (#2009)
* add dnsPolicy and dnsConfig to deployments and statefulsets * add dnsPolicy and dnsConfig in values for each component * add fix webmodeler name for params * update README * fixed empty space inside brackets * fixed dnsPolicy with empty string and dnsConfig with empty object * add unit test for console,connectors,identity,operate,optimze,tasklist * add unit test for zeebe and webmodeler * port to alpha * update README * fix unit test for console * add missing unit test for zeebe-gateway deployment in latest * backport unit tests to alpha
- Loading branch information
1 parent
be4abe7
commit 31b7c4f
Showing
46 changed files
with
886 additions
and
0 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
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
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
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -509,3 +509,35 @@ func (s *restapiDeploymentTemplateTest) TestContainerSetInitContainer() { | |
|
||
s.Require().Contains(podContainers, expectedContainer) | ||
} | ||
func (s *restapiDeploymentTemplateTest) TestSetDnsPolicyAndDnsConfig() { | ||
// given | ||
options := &helm.Options{ | ||
SetValues: map[string]string{ | ||
"webModeler.enabled": "true", | ||
"webModeler.restapi.mail.fromAddress": "[email protected]", | ||
"webModeler.restapi.dnsPolicy": "ClusterFirst", | ||
"webModeler.restapi.dnsConfig.nameservers[0]": "8.8.8.8", | ||
"webModeler.restapi.dnsConfig.searches[0]": "example.com", | ||
}, | ||
KubectlOptions: k8s.NewKubectlOptions("", "", s.namespace), | ||
} | ||
|
||
// when | ||
output := helm.RenderTemplate(s.T(), options, s.chartPath, s.release, s.templates) | ||
var deployment appsv1.Deployment | ||
helm.UnmarshalK8SYaml(s.T(), output, &deployment) | ||
|
||
// then | ||
// Check if dnsPolicy is set | ||
require.NotEmpty(s.T(), deployment.Spec.Template.Spec.DNSPolicy, "dnsPolicy should not be empty") | ||
|
||
// Check if dnsConfig is set | ||
require.NotNil(s.T(), deployment.Spec.Template.Spec.DNSConfig, "dnsConfig should not be nil") | ||
|
||
expectedDNSConfig := &corev1.PodDNSConfig{ | ||
Nameservers: []string{"8.8.8.8"}, | ||
Searches: []string{"example.com"}, | ||
} | ||
|
||
require.Equal(s.T(), expectedDNSConfig, deployment.Spec.Template.Spec.DNSConfig, "dnsConfig should match the expected configuration") | ||
} |
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 |
---|---|---|
|
@@ -220,3 +220,35 @@ func (s *webappDeploymentTemplateTest) TestContainerSetInitContainer() { | |
|
||
s.Require().Contains(podContainers, expectedContainer) | ||
} | ||
func (s *webappDeploymentTemplateTest) TestSetDnsPolicyAndDnsConfig() { | ||
// given | ||
options := &helm.Options{ | ||
SetValues: map[string]string{ | ||
"webModeler.enabled": "true", | ||
"webModeler.restapi.mail.fromAddress": "[email protected]", | ||
"webModeler.webapp.dnsPolicy": "ClusterFirst", | ||
"webModeler.webapp.dnsConfig.nameservers[0]": "8.8.8.8", | ||
"webModeler.webapp.dnsConfig.searches[0]": "example.com", | ||
}, | ||
KubectlOptions: k8s.NewKubectlOptions("", "", s.namespace), | ||
} | ||
|
||
// when | ||
output := helm.RenderTemplate(s.T(), options, s.chartPath, s.release, s.templates) | ||
var deployment appsv1.Deployment | ||
helm.UnmarshalK8SYaml(s.T(), output, &deployment) | ||
|
||
// then | ||
// Check if dnsPolicy is set | ||
require.NotEmpty(s.T(), deployment.Spec.Template.Spec.DNSPolicy, "dnsPolicy should not be empty") | ||
|
||
// Check if dnsConfig is set | ||
require.NotNil(s.T(), deployment.Spec.Template.Spec.DNSConfig, "dnsConfig should not be nil") | ||
|
||
expectedDNSConfig := &corev1.PodDNSConfig{ | ||
Nameservers: []string{"8.8.8.8"}, | ||
Searches: []string{"example.com"}, | ||
} | ||
|
||
require.Equal(s.T(), expectedDNSConfig, deployment.Spec.Template.Spec.DNSConfig, "dnsConfig should match the expected configuration") | ||
} |
Oops, something went wrong.