Skip to content

Commit

Permalink
expose allowed container names in Helm chart values (#15)
Browse files Browse the repository at this point in the history
  • Loading branch information
danfromtitan authored Aug 24, 2022
1 parent afad8e3 commit 8fc258a
Show file tree
Hide file tree
Showing 5 changed files with 16 additions and 14 deletions.
3 changes: 2 additions & 1 deletion .github/workflows/build-image.yml
Original file line number Diff line number Diff line change
Expand Up @@ -166,7 +166,8 @@ jobs:
run: |
IMAGE_TAG=latest
[[ "${{contains(needs.build.result, 'success') }}" == "true" ]] && IMAGE_TAG=${{ needs.build.outputs.image-tag }}
helm install -n $NAMESPACE --create-namespace envars-webhook envars-webhook/envars-webhook --set image.tag="$IMAGE_TAG"
helm install -n $NAMESPACE --create-namespace envars-webhook envars-webhook/envars-webhook --set image.tag="$IMAGE_TAG" \
--set webhook.containersAllowed.ingester=true,webhook.containersAllowed.prober=true,webhook.containersAllowed.store-gateway=true
until kubectl get pods -n $NAMESPACE | grep "Running" > /dev/null; do
kubectl get pods -n $NAMESPACE | tail -n +2
sleep 1
Expand Down
2 changes: 1 addition & 1 deletion charts/envars-webhook/Chart.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -3,4 +3,4 @@ name: envars-webhook
description: Generate TLS cert and deploy the webhook
type: application
appVersion: "0.1.0"
version: 0.1.4
version: 0.1.5
12 changes: 4 additions & 8 deletions charts/envars-webhook/README.md
Original file line number Diff line number Diff line change
Expand Up @@ -21,19 +21,15 @@ helm upgrade --install \
--namespace $NAMESPACE \
--create-namespace \
envars-webhook envars-webhook/envars-webhook \
-f values.yaml
--set webhook.namespaceSelector=samples \
--set webhook.verboseLogs=true \
--set webhook.containersAllowed.ingester=true,webhook.containersAllowed.prober=true,webhook.containersAllowed.store-gateway=true
```


### Verification

```bash
NAMESPACE=webtest
kubectl get secret -n $NAMESPACE envars-webhook-tls -o 'go-template={{index .data "tls.crt"}}' | base64 -d | openssl x509 -text -noout
kubectl get pods -n $NAMESPACE
kubectl logs -f -n $NAMESPACE pod-name
kubectl get mutatingwebhookconfigurations envars-webhook -o yaml
```
Follow the notes in Helm deployment output to verify the deployment.


### Uninstall
Expand Down
8 changes: 4 additions & 4 deletions charts/envars-webhook/templates/configmap.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -8,8 +8,8 @@ metadata:
data:
config.yml: |
verboseLogs: {{ .Values.webhook.verboseLogs | default "false" }}
{{- with .Values.webhook.containersAllowed }}
containersAllowed:
compactor: false
ingester: true
prober: true
store-gateway: true
{{- toYaml . | nindent 6 }}
{{- end }}
5 changes: 5 additions & 0 deletions charts/envars-webhook/values.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -68,3 +68,8 @@ webhook:
namespaceSelector: samples
# Show the JSON body for requests and responses in webhook logs
verboseLogs: false
# Map of container names allowed to receive node labels. False value or missing container name means node labels are not exposed.
containersAllowed:
ingester: false
prober: false
store-gateway: false

0 comments on commit 8fc258a

Please sign in to comment.