Skip to content

Commit

Permalink
Update generated helm manifests
Browse files Browse the repository at this point in the history
  • Loading branch information
Logiraptor committed Jun 6, 2022
1 parent 0d00537 commit 1f28881
Show file tree
Hide file tree
Showing 96 changed files with 2,589 additions and 225 deletions.
Original file line number Diff line number Diff line change
@@ -0,0 +1,111 @@
---
# Source: mimir-distributed/charts/minio/templates/configmap.yaml
apiVersion: v1
kind: ConfigMap
metadata:
name: test-enterprise-values-minio
labels:
app: minio
chart: minio-8.0.10
release: test-enterprise-values
heritage: Helm
data:
initialize: |-
#!/bin/sh
set -e ; # Have script exit in the event of a failed command.
MC_CONFIG_DIR="/etc/minio/mc/"
MC="/usr/bin/mc --insecure --config-dir ${MC_CONFIG_DIR}"
# connectToMinio
# Use a check-sleep-check loop to wait for Minio service to be available
connectToMinio() {
SCHEME=$1
ATTEMPTS=0 ; LIMIT=29 ; # Allow 30 attempts
set -e ; # fail if we can't read the keys.
ACCESS=$(cat /config/accesskey) ; SECRET=$(cat /config/secretkey) ;
set +e ; # The connections to minio are allowed to fail.
echo "Connecting to Minio server: $SCHEME://$MINIO_ENDPOINT:$MINIO_PORT" ;
MC_COMMAND="${MC} config host add myminio $SCHEME://$MINIO_ENDPOINT:$MINIO_PORT $ACCESS $SECRET" ;
$MC_COMMAND ;
STATUS=$? ;
until [ $STATUS = 0 ]
do
ATTEMPTS=`expr $ATTEMPTS + 1` ;
echo \"Failed attempts: $ATTEMPTS\" ;
if [ $ATTEMPTS -gt $LIMIT ]; then
exit 1 ;
fi ;
sleep 2 ; # 1 second intervals between attempts
$MC_COMMAND ;
STATUS=$? ;
done ;
set -e ; # reset `e` as active
return 0
}
# checkBucketExists ($bucket)
# Check if the bucket exists, by using the exit code of `mc ls`
checkBucketExists() {
BUCKET=$1
CMD=$(${MC} ls myminio/$BUCKET > /dev/null 2>&1)
return $?
}
# createBucket ($bucket, $policy, $purge)
# Ensure bucket exists, purging if asked to
createBucket() {
BUCKET=$1
POLICY=$2
PURGE=$3
VERSIONING=$4
# Purge the bucket, if set & exists
# Since PURGE is user input, check explicitly for `true`
if [ $PURGE = true ]; then
if checkBucketExists $BUCKET ; then
echo "Purging bucket '$BUCKET'."
set +e ; # don't exit if this fails
${MC} rm -r --force myminio/$BUCKET
set -e ; # reset `e` as active
else
echo "Bucket '$BUCKET' does not exist, skipping purge."
fi
fi
# Create the bucket if it does not exist
if ! checkBucketExists $BUCKET ; then
echo "Creating bucket '$BUCKET'"
${MC} mb myminio/$BUCKET
else
echo "Bucket '$BUCKET' already exists."
fi
# set versioning for bucket
if [ ! -z $VERSIONING ] ; then
if [ $VERSIONING = true ] ; then
echo "Enabling versioning for '$BUCKET'"
${MC} version enable myminio/$BUCKET
elif [ $VERSIONING = false ] ; then
echo "Suspending versioning for '$BUCKET'"
${MC} version suspend myminio/$BUCKET
fi
else
echo "Bucket '$BUCKET' versioning unchanged."
fi
# At this point, the bucket should exist, skip checking for existence
# Set policy on the bucket
echo "Setting policy of bucket '$BUCKET' to '$POLICY'."
${MC} policy set $POLICY myminio/$BUCKET
}
# Try connecting to Minio instance
scheme=http
connectToMinio $scheme
# Create the buckets
createBucket mimir-tsdb none false
createBucket mimir-ruler none false
createBucket enterprise-metrics-tsdb none false
createBucket enterprise-metrics-admin none false
createBucket enterprise-metrics-ruler none false
Original file line number Diff line number Diff line change
@@ -0,0 +1,72 @@
---
# Source: mimir-distributed/charts/minio/templates/deployment.yaml
apiVersion: apps/v1
kind: Deployment
metadata:
name: test-enterprise-values-minio
labels:
app: minio
chart: minio-8.0.10
release: test-enterprise-values
heritage: Helm
spec:
strategy:
type: RollingUpdate
rollingUpdate:
maxSurge: 100%
maxUnavailable: 0
selector:
matchLabels:
app: minio
release: test-enterprise-values
template:
metadata:
name: test-enterprise-values-minio
labels:
app: minio
release: test-enterprise-values
annotations:
checksum/secrets: aac2dea246043210c2649ffaf6c6ea57cd94d0aaf2b21759b8b38a093096478e
checksum/config: 8109517e3e9f729fb84cca8217b59099354497df0ca310f4e4b07d4951b02dc4
spec:
serviceAccountName: "test-enterprise-values-minio"
securityContext:
runAsUser: 1000
runAsGroup: 1000
fsGroup: 1000
containers:
- name: minio
image: "minio/minio:RELEASE.2021-02-14T04-01-33Z"
imagePullPolicy: IfNotPresent
command:
- "/bin/sh"
- "-ce"
- "/usr/bin/docker-entrypoint.sh minio -S /etc/minio/certs/ server /export"
volumeMounts:
- name: export
mountPath: /export
ports:
- name: http
containerPort: 9000
env:
- name: MINIO_ACCESS_KEY
valueFrom:
secretKeyRef:
name: test-enterprise-values-minio
key: accesskey
- name: MINIO_SECRET_KEY
valueFrom:
secretKeyRef:
name: test-enterprise-values-minio
key: secretkey
resources:
requests:
cpu: 100m
memory: 128Mi
volumes:
- name: export
persistentVolumeClaim:
claimName: test-enterprise-values-minio
- name: minio-user
secret:
secretName: test-enterprise-values-minio
Original file line number Diff line number Diff line change
@@ -0,0 +1,47 @@
---
# Source: mimir-distributed/charts/minio/templates/post-install-create-bucket-job.yaml
apiVersion: batch/v1
kind: Job
metadata:
name: test-enterprise-values-minio-make-bucket-job
labels:
app: minio-make-bucket-job
chart: minio-8.0.10
release: test-enterprise-values
heritage: Helm
annotations:
"helm.sh/hook": post-install,post-upgrade
"helm.sh/hook-delete-policy": hook-succeeded,before-hook-creation
spec:
template:
metadata:
labels:
app: minio-job
release: test-enterprise-values
spec:
restartPolicy: OnFailure
volumes:
- name: minio-configuration
projected:
sources:
- configMap:
name: test-enterprise-values-minio
- secret:
name: test-enterprise-values-minio
serviceAccountName: "test-enterprise-values-minio"
containers:
- name: minio-mc
image: "minio/mc:RELEASE.2021-02-14T04-28-06Z"
imagePullPolicy: IfNotPresent
command: ["/bin/sh", "/config/initialize"]
env:
- name: MINIO_ENDPOINT
value: test-enterprise-values-minio
- name: MINIO_PORT
value: "9000"
volumeMounts:
- name: minio-configuration
mountPath: /config
resources:
requests:
memory: 128Mi
Original file line number Diff line number Diff line change
@@ -0,0 +1,37 @@
---
# Source: mimir-distributed/charts/minio/templates/post-install-prometheus-metrics-role.yaml
apiVersion: rbac.authorization.k8s.io/v1
kind: Role
metadata:
name: test-enterprise-values-minio-update-prometheus-secret
labels:
app: minio-update-prometheus-secret
chart: minio-8.0.10
release: test-enterprise-values
heritage: Helm
rules:
- apiGroups:
- ""
resources:
- secrets
verbs:
- get
- create
- update
- patch
resourceNames:
- test-enterprise-values-minio-prometheus
- apiGroups:
- ""
resources:
- secrets
verbs:
- create
- apiGroups:
- monitoring.coreos.com
resources:
- servicemonitors
verbs:
- get
resourceNames:
- test-enterprise-values-minio
Original file line number Diff line number Diff line change
@@ -0,0 +1,19 @@
---
# Source: mimir-distributed/charts/minio/templates/post-install-prometheus-metrics-rolebinding.yaml
apiVersion: rbac.authorization.k8s.io/v1
kind: RoleBinding
metadata:
name: test-enterprise-values-minio-update-prometheus-secret
labels:
app: minio-update-prometheus-secret
chart: minio-8.0.10
release: test-enterprise-values
heritage: Helm
roleRef:
apiGroup: rbac.authorization.k8s.io
kind: Role
name: test-enterprise-values-minio-update-prometheus-secret
subjects:
- kind: ServiceAccount
name: test-enterprise-values-minio-update-prometheus-secret
namespace: "default"
Original file line number Diff line number Diff line change
@@ -0,0 +1,11 @@
---
# Source: mimir-distributed/charts/minio/templates/post-install-prometheus-metrics-serviceaccount.yaml
apiVersion: v1
kind: ServiceAccount
metadata:
name: test-enterprise-values-minio-update-prometheus-secret
labels:
app: minio-update-prometheus-secret
chart: minio-8.0.10
release: test-enterprise-values
heritage: Helm
Original file line number Diff line number Diff line change
@@ -0,0 +1,17 @@
---
# Source: mimir-distributed/charts/minio/templates/pvc.yaml
apiVersion: v1
kind: PersistentVolumeClaim
metadata:
name: test-enterprise-values-minio
labels:
app: minio
chart: minio-8.0.10
release: test-enterprise-values
heritage: Helm
spec:
accessModes:
- "ReadWriteOnce"
resources:
requests:
storage: "5Gi"
Original file line number Diff line number Diff line change
@@ -0,0 +1,15 @@
---
# Source: mimir-distributed/charts/minio/templates/secrets.yaml
apiVersion: v1
kind: Secret
metadata:
name: test-enterprise-values-minio
labels:
app: minio
chart: minio-8.0.10
release: test-enterprise-values
heritage: Helm
type: Opaque
data:
accesskey: "Z3JhZmFuYS1taW1pcg=="
secretkey: "c3VwZXJzZWNyZXQ="
Original file line number Diff line number Diff line change
@@ -0,0 +1,21 @@
---
# Source: mimir-distributed/charts/minio/templates/service.yaml
apiVersion: v1
kind: Service
metadata:
name: test-enterprise-values-minio
labels:
app: minio
chart: minio-8.0.10
release: test-enterprise-values
heritage: Helm
spec:
type: ClusterIP
ports:
- name: http
port: 9000
protocol: TCP
targetPort: 9000
selector:
app: minio
release: test-enterprise-values
Original file line number Diff line number Diff line change
@@ -0,0 +1,11 @@
---
# Source: mimir-distributed/charts/minio/templates/serviceaccount.yaml
apiVersion: v1
kind: ServiceAccount
metadata:
name: "test-enterprise-values-minio"
namespace: "default"
labels:
app: minio
chart: minio-8.0.10
release: "test-enterprise-values"
Loading

0 comments on commit 1f28881

Please sign in to comment.