Skip to content

Commit

Permalink
cleanup: remove service, sa, ingress, hpa
Browse files Browse the repository at this point in the history
  • Loading branch information
lemeurherveCB committed Oct 24, 2022
1 parent e0d09a2 commit 2979938
Show file tree
Hide file tree
Showing 9 changed files with 7 additions and 218 deletions.
23 changes: 1 addition & 22 deletions charts/rss2twitter/templates/NOTES.txt
Original file line number Diff line number Diff line change
@@ -1,22 +1 @@
1. Get the application URL by running these commands:
{{- if .Values.ingress.enabled }}
{{- range $host := .Values.ingress.hosts }}
{{- range .paths }}
http{{ if $.Values.ingress.tls }}s{{ end }}://{{ $host.host }}{{ .path }}
{{- end }}
{{- end }}
{{- else if contains "NodePort" .Values.service.type }}
export NODE_PORT=$(kubectl get --namespace {{ .Release.Namespace }} -o jsonpath="{.spec.ports[0].nodePort}" services {{ include "rss2twitter.fullname" . }})
export NODE_IP=$(kubectl get nodes --namespace {{ .Release.Namespace }} -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 {{ .Release.Namespace }} svc -w {{ include "rss2twitter.fullname" . }}'
export SERVICE_IP=$(kubectl get svc --namespace {{ .Release.Namespace }} {{ include "rss2twitter.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 {{ .Release.Namespace }} -l "app.kubernetes.io/name={{ include "rss2twitter.name" . }},app.kubernetes.io/instance={{ .Release.Name }}" -o jsonpath="{.items[0].metadata.name}")
export CONTAINER_PORT=$(kubectl get pod --namespace {{ .Release.Namespace }} $POD_NAME -o jsonpath="{.spec.containers[0].ports[0].containerPort}")
echo "Visit http://127.0.0.1:8080 to use your application"
kubectl --namespace {{ .Release.Namespace }} port-forward $POD_NAME 8080:$CONTAINER_PORT
{{- end }}
Consult the pod logs to see if the app is running.
11 changes: 0 additions & 11 deletions charts/rss2twitter/templates/_helpers.tpl
Original file line number Diff line number Diff line change
Expand Up @@ -49,14 +49,3 @@ Selector labels
app.kubernetes.io/name: {{ include "rss2twitter.name" . }}
app.kubernetes.io/instance: {{ .Release.Name }}
{{- end }}

{{/*
Create the name of the service account to use
*/}}
{{- define "rss2twitter.serviceAccountName" -}}
{{- if .Values.serviceAccount.create }}
{{- default (include "rss2twitter.fullname" .) .Values.serviceAccount.name }}
{{- else }}
{{- default "default" .Values.serviceAccount.name }}
{{- end }}
{{- end }}
11 changes: 0 additions & 11 deletions charts/rss2twitter/templates/deployment.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -5,9 +5,7 @@ metadata:
labels:
{{- include "rss2twitter.labels" . | nindent 4 }}
spec:
{{- if not .Values.autoscaling.enabled }}
replicas: {{ .Values.replicaCount }}
{{- end }}
selector:
matchLabels:
{{- include "rss2twitter.selectorLabels" . | nindent 6 }}
Expand All @@ -24,7 +22,6 @@ spec:
imagePullSecrets:
{{- toYaml . | nindent 8 }}
{{- end }}
serviceAccountName: {{ include "rss2twitter.serviceAccountName" . }}
securityContext:
{{- toYaml .Values.podSecurityContext | nindent 8 }}
containers:
Expand All @@ -33,21 +30,13 @@ spec:
{{- toYaml .Values.securityContext | nindent 12 }}
image: "{{ .Values.image.repository }}:{{ .Values.image.tag | default .Chart.AppVersion }}"
imagePullPolicy: {{ .Values.image.pullPolicy }}
ports:
- name: http
containerPort: 80
protocol: TCP
livenessProbe:
exec:
command:
- pgrep
- rss2twitter
initialDelaySeconds: 10
periodSeconds: 10
readinessProbe:
httpGet:
path: /
port: http
resources:
{{- toYaml .Values.resources | nindent 12 }}
volumeMounts:
Expand Down
28 changes: 0 additions & 28 deletions charts/rss2twitter/templates/hpa.yaml

This file was deleted.

61 changes: 0 additions & 61 deletions charts/rss2twitter/templates/ingress.yaml

This file was deleted.

15 changes: 0 additions & 15 deletions charts/rss2twitter/templates/service.yaml

This file was deleted.

12 changes: 0 additions & 12 deletions charts/rss2twitter/templates/serviceaccount.yaml

This file was deleted.

15 changes: 0 additions & 15 deletions charts/rss2twitter/templates/tests/test-connection.yaml

This file was deleted.

49 changes: 6 additions & 43 deletions charts/rss2twitter/values.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -14,47 +14,17 @@ imagePullSecrets: []
nameOverride: ""
fullnameOverride: ""

serviceAccount:
# Specifies whether a service account should be created
create: true
# Annotations to add to the service account
annotations: {}
# The name of the service account to use.
# If not set and create is true, a name is generated using the fullname template
name: ""

podAnnotations: {}

podSecurityContext: {}
# fsGroup: 2000

securityContext: {}
# capabilities:
# drop:
# - ALL
# readOnlyRootFilesystem: true
# runAsNonRoot: true
# runAsUser: 1000

service:
type: ClusterIP
port: 80

ingress:
enabled: false
className: ""
annotations: {}
# kubernetes.io/ingress.class: nginx
# kubernetes.io/tls-acme: "true"
hosts:
- host: chart-example.local
paths:
- path: /
pathType: ImplementationSpecific
tls: []
# - secretName: chart-example-tls
# hosts:
# - chart-example.local
securityContext:
capabilities:
drop:
- ALL
readOnlyRootFilesystem: true
runAsNonRoot: true

resources: {}
# We usually recommend not to specify default resources and to leave this as a conscious
Expand All @@ -68,13 +38,6 @@ resources: {}
# cpu: 100m
# memory: 128Mi

autoscaling:
enabled: false
minReplicas: 1
maxReplicas: 100
targetCPUUtilizationPercentage: 80
# targetMemoryUtilizationPercentage: 80

nodeSelector: {}

tolerations: []
Expand Down

0 comments on commit 2979938

Please sign in to comment.