Rearrange deployment files into kustomizations
This commit is contained in:
parent
1bd3fd2429
commit
51ad0bc54b
56 changed files with 532 additions and 1094 deletions
|
|
@ -17,7 +17,6 @@ limitations under the License.
|
|||
package defaultbackend
|
||||
|
||||
import (
|
||||
"fmt"
|
||||
"net/http"
|
||||
"strings"
|
||||
|
||||
|
|
@ -40,7 +39,7 @@ var _ = framework.IngressNginxDescribe("Custom Default Backend", func() {
|
|||
framework.UpdateDeployment(f.KubeClientSet, f.Namespace, "nginx-ingress-controller", 1,
|
||||
func(deployment *appsv1beta1.Deployment) error {
|
||||
args := deployment.Spec.Template.Spec.Containers[0].Args
|
||||
args = append(args, fmt.Sprintf("--default-backend-service=%s/%s", f.Namespace, "http-svc"))
|
||||
args = append(args, "--default-backend-service=$(POD_NAMESPACE)/http-svc")
|
||||
deployment.Spec.Template.Spec.Containers[0].Args = args
|
||||
_, err := f.KubeClientSet.AppsV1beta1().Deployments(f.Namespace).Update(deployment)
|
||||
|
||||
|
|
|
|||
|
|
@ -17,6 +17,7 @@ limitations under the License.
|
|||
package settings
|
||||
|
||||
import (
|
||||
"fmt"
|
||||
"net/http"
|
||||
"strings"
|
||||
|
||||
|
|
@ -48,7 +49,7 @@ var _ = framework.IngressNginxDescribe("[Serial] Pod Security Policies", func()
|
|||
Expect(err).NotTo(HaveOccurred(), "creating Pod Security Policy")
|
||||
}
|
||||
|
||||
role, err := f.KubeClientSet.RbacV1().ClusterRoles().Get("nginx-ingress-clusterrole", metav1.GetOptions{})
|
||||
role, err := f.KubeClientSet.RbacV1().ClusterRoles().Get(fmt.Sprintf("nginx-ingress-clusterrole-%v", f.Namespace), metav1.GetOptions{})
|
||||
Expect(err).NotTo(HaveOccurred(), "getting ingress controller cluster role")
|
||||
Expect(role).NotTo(BeNil())
|
||||
|
||||
|
|
@ -78,7 +79,7 @@ var _ = framework.IngressNginxDescribe("[Serial] Pod Security Policies", func()
|
|||
})
|
||||
|
||||
AfterEach(func() {
|
||||
role, err := f.KubeClientSet.RbacV1().ClusterRoles().Get("nginx-ingress-clusterrole", metav1.GetOptions{})
|
||||
role, err := f.KubeClientSet.RbacV1().ClusterRoles().Get(fmt.Sprintf("nginx-ingress-clusterrole-%v", f.Namespace), metav1.GetOptions{})
|
||||
Expect(err).NotTo(HaveOccurred(), "getting ingress controller cluster role")
|
||||
Expect(role).NotTo(BeNil())
|
||||
|
||||
|
|
|
|||
|
|
@ -35,10 +35,32 @@ function on_exit {
|
|||
}
|
||||
trap on_exit EXIT
|
||||
|
||||
kubectl apply --namespace=$NAMESPACE -f $DIR/manifests/service.yaml
|
||||
CLUSTER_WIDE="$DIR/cluster-wide-$NAMESPACE"
|
||||
|
||||
sed "s@\${NAMESPACE}@${NAMESPACE}@" $DIR/manifests/mandatory.yaml | kubectl apply --namespace=$NAMESPACE -f -
|
||||
cat $DIR/manifests/service.yaml | kubectl apply --namespace=$NAMESPACE -f -
|
||||
mkdir "$CLUSTER_WIDE"
|
||||
|
||||
cat << EOF > "$CLUSTER_WIDE/kustomization.yaml"
|
||||
apiVersion: kustomize.config.k8s.io/v1beta1
|
||||
kind: Kustomization
|
||||
bases:
|
||||
- ../cluster-wide
|
||||
nameSuffix: "-$NAMESPACE"
|
||||
EOF
|
||||
|
||||
OVERLAY="$DIR/overlay-$NAMESPACE"
|
||||
|
||||
mkdir "$OVERLAY"
|
||||
|
||||
cat << EOF > "$OVERLAY/kustomization.yaml"
|
||||
apiVersion: kustomize.config.k8s.io/v1beta1
|
||||
kind: Kustomization
|
||||
namespace: $NAMESPACE
|
||||
bases:
|
||||
- ../overlay
|
||||
- ../cluster-wide-$NAMESPACE
|
||||
EOF
|
||||
|
||||
kubectl apply --kustomize "$OVERLAY"
|
||||
|
||||
# wait for the deployment and fail if there is an error before starting the execution of any test
|
||||
kubectl rollout status \
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue