Skip to content

Instantly share code, notes, and snippets.

@knrt10
Last active July 14, 2021 12:18
Show Gist options
  • Save knrt10/63856f18fbb73681b759fb519453d156 to your computer and use it in GitHub Desktop.
Save knrt10/63856f18fbb73681b759fb519453d156 to your computer and use it in GitHub Desktop.
#!/usr/bin/env bash
helm create santosh-test-helm
cd santosh-test-helm/
rm -rf templates charts
mkdir templates/
cat <<EOF | tee templates/deploy.yaml
apiVersion: apps/v1
kind: Deployment
metadata:
creationTimestamp: null
labels:
app: github-action-runner
name: github-action-runner
namespace: {{ .Release.Namespace }}
spec:
replicas: 1
selector:
matchLabels:
app: github-action-runner
strategy: {}
template:
metadata:
creationTimestamp: null
labels:
app: github-action-runner
spec:
containers:
- image: nginx
name: nginx
resources: {}
status: {}
EOF
cat <<EOF | tee templates/ns.yaml
apiVersion: v1
kind: Namespace
metadata:
name: test
spec: {}
status: {}
EOF
cat <<EOF | tee templates/sa.yaml
apiVersion: v1
kind: ServiceAccount
metadata:
namespace: test
name: test
EOF
helm install santosh-test-helm ./
echo
echo "Helm chart released succesfully"
echo "------------------------------------------------"
echo
echo "Getting service account in test namespace"
echo "------------------------------------------------"
kubectl get sa -n test
echo
echo "Getting deployment in default namespace"
echo "------------------------------------------------"
kubectl get deploy
echo
echo "Do the cleanup yourself bitch by running below command"
echo "------------------------------------------------"
echo "helm uninstall santosh-test-helm && rm -rf santosh-test-helm"
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment