Skip to content
This repository has been archived by the owner on Oct 3, 2023. It is now read-only.

Commit

Permalink
Merge pull request #6 from epics-containers/dev
Browse files Browse the repository at this point in the history
remove explicit namespaces
  • Loading branch information
gilesknap authored Mar 24, 2023
2 parents d3afcbd + 07935a2 commit d4b028c
Show file tree
Hide file tree
Showing 6 changed files with 25 additions and 17 deletions.
12 changes: 6 additions & 6 deletions templates/NOTES.txt
Original file line number Diff line number Diff line change
Expand Up @@ -6,16 +6,16 @@
{{- end }}
{{- end }}
{{- else if contains "NodePort" .Values.service.type }}
export NODE_PORT=$(kubectl get --namespace {{ .Values.namespace }} -o jsonpath="{.spec.ports[0].nodePort}" services {{ include "ioc-chart.fullname" . }})
export NODE_IP=$(kubectl get nodes --namespace {{ .Values.namespace }} -o jsonpath="{.items[0].status.addresses[0].address}")
export NODE_PORT=$(kubectl get -o jsonpath="{.spec.ports[0].nodePort}" services {{ include "ioc-chart.fullname" . }})
export NODE_IP=$(kubectl get nodes -o jsonpath="{.items[0].status.addresses[0].address}")
echo http://$NODE_IP:$NODE_PORT
{{- else if contains "LoadBalancer" .Values.service.type }}
NOTE: It may take a few minutes for the LoadBalancer IP to be available.
You can watch the status of by running 'kubectl get --namespace {{ .Values.namespace }} svc -w {{ include "ioc-chart.fullname" . }}'
export SERVICE_IP=$(kubectl get svc --namespace {{ .Values.namespace }} {{ include "ioc-chart.fullname" . }} --template "{{"{{ range (index .status.loadBalancer.ingress 0) }}{{.}}{{ end }}"}}")
You can watch the status of by running 'kubectl get svc -w {{ include "ioc-chart.fullname" . }}'
export SERVICE_IP=$(kubectl get svc {{ include "ioc-chart.fullname" . }} --template "{{"{{ range (index .status.loadBalancer.ingress 0) }}{{.}}{{ end }}"}}")
echo http://$SERVICE_IP:{{ .Values.service.port }}
{{- else if contains "ClusterIP" .Values.service.type }}
export POD_NAME=$(kubectl get pods --namespace {{ .Values.namespace }} -l "app.kubernetes.io/name={{ include "ioc-chart.name" . }},app.kubernetes.io/instance={{ .Release.Name }}" -o jsonpath="{.items[0].metadata.name}")
export POD_NAME=$(kubectl get pods -l "app.kubernetes.io/name={{ include "ioc-chart.name" . }},app.kubernetes.io/instance={{ .Release.Name }}" -o jsonpath="{.items[0].metadata.name}")
echo "Visit http://127.0.0.1:8080 to use your application"
kubectl --namespace {{ .Values.namespace }} port-forward $POD_NAME 8080:80
kubectl port-forward $POD_NAME 8080:80
{{- end }}
1 change: 0 additions & 1 deletion templates/_configmap.tpl
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,6 @@ apiVersion: v1
kind: ConfigMap
metadata:
name: {{ .Chart.Name }}
namespace: {{ .Values.namespace }}
labels:
app: {{ .Chart.Name }}
beamline: {{ .Values.beamline }}
Expand Down
19 changes: 16 additions & 3 deletions templates/_deployment.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,6 @@ apiVersion: apps/v1
kind: Deployment
metadata:
name: {{ .Chart.Name }}
namespace: {{ .Values.namespace }}
labels:
app: {{ .Chart.Name }}
beamline: {{ .Values.beamline }}
Expand All @@ -25,9 +24,11 @@ spec:
ioc_version: {{ .Chart.AppVersion | quote }}
is_ioc: "True"
spec:
{{ if .Values.serviceAccountName }}
serviceAccountName: {{ .Values.serviceAccount | default "epics-iocs-priv" | quote }}
{{- end }}
hostNetwork: {{ .Values.hostNetwork }}
terminationGracePeriodSeconds: 5 # nice to have quick restarts on IOCs
terminationGracePeriodSeconds: 15 # nice to have quick restarts on IOCs
volumes:
{{- if .Values.nfsv2TftpClaim }}
- name: nfsv2-tftp-volume
Expand Down Expand Up @@ -58,7 +59,19 @@ spec:
command:
- bash
args:
- {{ .Values.iocFolder }}/config/start.sh
- {{ .Values.iocFolder }}/start.sh
livenessProbe:
exec:
command:
- /bin/bash
- /repos/epics/ioc/liveness.sh
initialDelaySeconds: 120
periodSeconds: 10
lifecycle:
preStop:
exec:
# TODO move this up into ioc folder (in ioc-template itself)
command: ["bash", "-c", "/repos/epics/ioc/stop.sh"]
volumeMounts:
- name: config-volume
mountPath: {{ .Values.iocFolder }}/config
Expand Down
2 changes: 0 additions & 2 deletions templates/_ioc-volume.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,6 @@ kind: PersistentVolumeClaim
apiVersion: v1
metadata:
name: {{ .Chart.Name }}
namespace: {{ .Values.namespace }}
labels:
app: {{ .Chart.Name }}
beamline: {{ .Values.beamline }}
Expand All @@ -24,7 +23,6 @@ kind: PersistentVolumeClaim
apiVersion: v1
metadata:
name: {{ .Chart.Name }}-data
namespace: {{ .Values.namespace }}
labels:
app: {{ .Chart.Name }}
beamline: {{ .Values.beamline }}
Expand Down
2 changes: 0 additions & 2 deletions templates/_service.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,6 @@ apiVersion: v1
kind: Service
metadata:
name: {{ .Chart.Name }}-tcp
namespace: {{ .Values.namespace }}
annotations:
metallb.universe.tf/allow-shared-ip: {{ .Chart.Name }}
labels:
Expand All @@ -26,7 +25,6 @@ apiVersion: v1
kind: Service
metadata:
name: {{ .Chart.Name }}-udp
namespace: {{ .Values.namespace }}
annotations:
metallb.universe.tf/allow-shared-ip: {{ .Chart.Name }}
labels:
Expand Down
6 changes: 3 additions & 3 deletions values.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,6 @@
# Declare variables to be passed into your templates.
exports:
defaults:
namespace: epics-iocs
beamline: no-beamline! (always override this)

# to support channel access and other protocols we need to run in host's network
Expand All @@ -22,8 +21,9 @@ exports:
# A path on the host machine to write data into, ignored if dataVolume.pvc is true
hostPath: ""

# set this to your namespace service account
serviceAccount: epics-iocs-priv
# set this to your enforce namespace service account
# leave blank for default service account
# serviceAccount: epics-iocs-priv

# provide some reasonable defaults here but allow override
securityContext:
Expand Down

0 comments on commit d4b028c

Please sign in to comment.