This file contains hidden or 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
#!/bin/bash | |
set -e | |
set -o pipefail | |
# Add user to k8s using service account, no RBAC (must create RBAC after this script) | |
if [[ -z "$1" ]] || [[ -z "$2" ]]; then | |
echo "usage: $0 <service_account_name> <namespace>" | |
exit 1 | |
fi |
This file contains hidden or 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
package deployment | |
import ( | |
"fmt" | |
"strings" | |
"terratest-demo/util" | |
"testing" | |
"time" | |
httpHelper "github.com/gruntwork-io/terratest/modules/http-helper" |
This file contains hidden or 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
package helm | |
import ( | |
"github.com/gruntwork-io/terratest/modules/helm" | |
"github.com/stretchr/testify/suite" | |
coreV1 "k8s.io/api/core/v1" | |
"testing" | |
) | |
type HelmRenderingSuite struct { |
This file contains hidden or 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
package helm | |
import ( | |
"fmt" | |
"github.com/gruntwork-io/terratest/modules/helm" | |
httpHelper "github.com/gruntwork-io/terratest/modules/http-helper" | |
"github.com/gruntwork-io/terratest/modules/k8s" | |
"github.com/gruntwork-io/terratest/modules/random" | |
"github.com/stretchr/testify/assert" | |
"github.com/stretchr/testify/suite" |
This file contains hidden or 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
package main | |
import ( | |
http_helper "github.com/gruntwork-io/terratest/modules/http-helper" | |
"github.com/gruntwork-io/terratest/modules/terraform" | |
"testing" | |
"time" | |
) | |
func TestWebServer(t *testing.T) { |
This file contains hidden or 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
#!/usr/bin/bash | |
# Don't forget to change your schemas location. | |
declare -a supported_versions | |
supported_versions=(v1.17.0 v1.16.0 v1.15.0) | |
EXTRACT_COMMAND="mkdir -p ~/.kubeval/schemas && \ | |
curl https://codeload.github.com/instrumenta/kubernetes-json-schema/tar.gz/master | \ | |
tar -C ~/.kubeval/schemas --strip-components=1 -xzvf - " | |
for sv in "${supported_versions[@]}" | |
do | |
echo "Supported version: $sv" |
This file contains hidden or 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
apiVersion: apps/v1 | |
kind: Deployment | |
metadata: | |
labels: | |
run: netshoot | |
name: netshoot | |
spec: | |
replicas: 2 | |
selector: | |
matchLabels: |
This file contains hidden or 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
#Then the MutatingAdmissionWebhook observes the requests to apiserver and intercepts requests matching the rules in admission webhooks and calls them in parallel. | |
# For each request to the apiserver, the MutatingAdmissionWebhook sends an admissionReview(API for reference) to the relevant webhook admission server. The webhook admission server gathers information like object, oldobject, and userInfo from admissionReview, and sends back a admissionReview response including AdmissionResponse whose Allowed and Result fields are filled with the admission decision and optional Patch to mutate the resoures. | |
# MutatingAdmissionWebhook needs to be registered in the apiserver by providing MutatingWebhookConfiguration. | |
# During the registration process, MutatingAdmissionWebhook states: | |
# - How to connect to the webhook admission server | |
# - How to verify the webhook admission server | |
# - The URL path of the webhook admission server | |
# - Rules defining which resource and what action it handles | |
# -How unrecogni |
This file contains hidden or 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
#!/usr/bin/env bash | |
PROJECT=sidecar-injector | |
: ${1?'missing key directory'} | |
key_dir="$1" | |
chmod 0700 "$key_dir" | |
cd "$key_dir" |
This file contains hidden or 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
apiVersion: v1 | |
kind: Service | |
metadata: | |
name: sidecar-injector-service | |
namespace: platform | |
spec: | |
selector: | |
app: sidecar-injector-server | |
ports: | |
- port: 443 |
OlderNewer