Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

add openshift resources to chart #125

Merged
merged 4 commits into from
Oct 18, 2024
Merged
Show file tree
Hide file tree
Changes from 1 commit
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
7 changes: 6 additions & 1 deletion charts/localstack/templates/NOTES.txt
Original file line number Diff line number Diff line change
Expand Up @@ -17,6 +17,11 @@
{{- else if contains "ClusterIP" .Values.service.type }}
export POD_NAME=$(kubectl get pods --namespace {{ .Release.Namespace | quote }} -l "app.kubernetes.io/name={{ include "localstack.name" . }},app.kubernetes.io/instance={{ .Release.Name }}" -o jsonpath="{.items[0].metadata.name}")
export CONTAINER_PORT=$(kubectl get pod --namespace {{ .Release.Namespace | quote }} $POD_NAME -o jsonpath="{.spec.containers[0].ports[0].containerPort}")
echo "Visit http://127.0.0.1:8080 to use your application"
echo "visit http://127.0.0.1:8080 to use your application"
kubectl --namespace {{ .Release.Namespace | quote }} port-forward $POD_NAME 8080:$CONTAINER_PORT
{{- end }}
{{- if and .Values.openshift .Values.route.enabled }}
export ROUTE_URL=$(oc get route localstack-fork --namespace "localstack" -o jsonpath="{.spec.host}")
echo http://$ROUTE_URL
echo "visit http://$ROUTE_URL to use your application"
{{- end }}
6 changes: 6 additions & 0 deletions charts/localstack/templates/role.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -19,4 +19,10 @@ rules:
- apiGroups: [""]
resources: ["services"]
verbs: ["get", "list"]
{{- if .Values.openshift }}
- apiGroups: ["security.openshift.io"]
resources: ["securitycontextconstraints"]
resourceNames: ["anyuid"]
verbs: ["use"]
{{- end }}
{{- end }}
21 changes: 21 additions & 0 deletions charts/localstack/templates/route.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,21 @@
{{- if and .Values.openshift .Values.route.enabled -}}
kind: Route
apiVersion: route.openshift.io/v1
metadata:
name: {{ template "localstack.fullname" . }}
namespace: {{ .Release.Namespace | quote }}
labels:
{{- include "localstack.labels" . | nindent 4 }}
spec:
host: {{ .Values.route.host }}
to:
kind: Service
name: {{ include "localstack.fullname" . }}
weight: 100
port:
targetPort: {{ .Values.route.port }}
wildcardPolicy: None
tls:
{{- toYaml .Values.route.tls | nindent 4 }}
{{- end }}

10 changes: 10 additions & 0 deletions charts/localstack/values.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -19,6 +19,10 @@ imagePullSecrets: []
nameOverride: ""
fullnameOverride: ""

## OpenShift. When set to 'true' it will add SecurityContextConstraings (SCC)
## to the role
openshift: false

## @param extraDeploy Extra objects to deploy (value evaluated as a template)
##
extraDeploy: []
Expand Down Expand Up @@ -155,6 +159,12 @@ ingress:
# hosts:
# - chart-example.local

## Create a Route resource if using OpenShift
## Defaults to the 'edge' port of the service on 4566
route:
enabled: false
port: edge

persistence:
## @param persistence.enabled Enable persistence using Persistent Volume Claims
##
Expand Down