-
Notifications
You must be signed in to change notification settings - Fork 9
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Merge branch 'main' into aastha/restric-k8s-permissions
- Loading branch information
Showing
27 changed files
with
824 additions
and
17 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -3,7 +3,7 @@ name: launch-agent | |
icon: https://em-content.zobj.net/thumbs/240/apple/354/rocket_1f680.png | ||
description: A Helm chart for running the W&B Launch Agent in Kubernetes | ||
type: application | ||
version: 0.13.3 | ||
version: 0.13.5 | ||
maintainers: | ||
- name: wandb | ||
email: [email protected] | ||
|
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,23 @@ | ||
# Patterns to ignore when building packages. | ||
# This supports shell glob matching, relative path matching, and | ||
# negation (prefixed with !). Only one pattern per line. | ||
.DS_Store | ||
# Common VCS dirs | ||
.git/ | ||
.gitignore | ||
.bzr/ | ||
.bzrignore | ||
.hg/ | ||
.hgignore | ||
.svn/ | ||
# Common backup files | ||
*.swp | ||
*.bak | ||
*.tmp | ||
*.orig | ||
*~ | ||
# Various IDEs | ||
.project | ||
.idea/ | ||
*.tmproj | ||
.vscode/ |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,15 @@ | ||
apiVersion: v2 | ||
name: nginx | ||
type: application | ||
description: A Helm chart for Kubernetes | ||
|
||
version: 0.1.0 | ||
appVersion: "1.25.5" | ||
|
||
home: https://wandb.ai | ||
icon: https://wandb.ai/logo.svg | ||
|
||
maintainers: | ||
- name: wandb | ||
email: [email protected] | ||
url: https://wandb.com |
124 changes: 124 additions & 0 deletions
124
charts/operator-wandb/charts/nginx/templates/_helpers.tpl
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,124 @@ | ||
{{/* vim: set filetype=mustache: */}} | ||
|
||
{{/* | ||
Expand the name of the chart. | ||
*/}} | ||
{{- define "nginx.name" -}} | ||
{{- default .Chart.Name .Values.nameOverride | trunc 63 | trimSuffix "-" }} | ||
{{- end }} | ||
|
||
{{/* | ||
Create a default fully qualified nginx name. | ||
We truncate at 63 chars because some Kubernetes name fields are limited to this (by the DNS naming spec). | ||
If release name contains chart name it will be used as a full name. | ||
*/}} | ||
{{- define "nginx.fullname" -}} | ||
{{- if .Values.fullnameOverride }} | ||
{{- .Values.fullnameOverride | trunc 63 | trimSuffix "-" }} | ||
{{- else }} | ||
{{- $name := default .Chart.Name .Values.nameOverride }} | ||
{{- if contains $name .Release.Name }} | ||
{{- .Release.Name | trunc 63 | trimSuffix "-" }} | ||
{{- else }} | ||
{{- printf "%s-%s" .Release.Name $name | trunc 63 | trimSuffix "-" }} | ||
{{- end }} | ||
{{- end }} | ||
{{- end }} | ||
|
||
{{/* | ||
Create chart name and version as used by the chart label. | ||
*/}} | ||
{{- define "nginx.chart" -}} | ||
{{- printf "%s-%s" .Chart.Name .Chart.Version | replace "+" "_" | trunc 63 | trimSuffix "-" }} | ||
{{- end }} | ||
|
||
{{/* | ||
Common labels | ||
*/}} | ||
{{- define "nginx.labels" -}} | ||
helm.sh/chart: {{ include "nginx.chart" . }} | ||
{{ include "nginx.selectorLabels" . }} | ||
{{- if .Chart.AppVersion }} | ||
app.kubernetes.io/version: {{ .Chart.AppVersion | quote }} | ||
{{- end }} | ||
wandb.com/app-name: {{ include "nginx.chart" . }} | ||
app.kubernetes.io/managed-by: {{ .Release.Service }} | ||
{{- end }} | ||
|
||
{{/* | ||
Selector labels | ||
*/}} | ||
{{- define "nginx.selectorLabels" -}} | ||
app.kubernetes.io/name: {{ include "nginx.name" . }} | ||
app.kubernetes.io/instance: {{ .Release.Name }} | ||
{{- end }} | ||
|
||
{{/* | ||
Create the name of the service account to use | ||
*/}} | ||
{{- define "nginx.serviceAccountName" -}} | ||
{{- if .Values.serviceAccount.create }} | ||
{{- default (include "nginx.fullname" .) .Values.serviceAccount.name }} | ||
{{- else }} | ||
{{- default "default" .Values.serviceAccount.name }} | ||
{{- end }} | ||
{{- end }} | ||
|
||
|
||
{{/* | ||
Returns a list of _common_ labels to be shared across all | ||
app deployments and other shared objects. | ||
*/}} | ||
{{- define "nginx.commonLabels" -}} | ||
{{- $commonLabels := default (dict) .Values.common.labels -}} | ||
{{- if $commonLabels }} | ||
{{- range $key, $value := $commonLabels }} | ||
{{ $key }}: {{ $value | quote }} | ||
{{- end }} | ||
{{- end -}} | ||
{{- end -}} | ||
|
||
{{/* | ||
Returns a list of _pod_ labels to be shared across all | ||
nginx deployments. | ||
*/}} | ||
{{- define "nginx.podLabels" -}} | ||
{{- range $key, $value := .Values.pod.labels }} | ||
{{ $key }}: {{ $value | quote }} | ||
{{- end }} | ||
{{- end -}} | ||
|
||
|
||
{{- define "nginx.nodeSelector" -}} | ||
{{- $nodeSelector := default .Values.global.nodeSelector .Values.nodeSelector -}} | ||
{{- if $nodeSelector }} | ||
nodeSelector: | ||
{{- toYaml $nodeSelector | nindent 2 }} | ||
{{- end }} | ||
{{- end -}} | ||
|
||
|
||
{{/* | ||
Return a PodSecurityContext definition. | ||
Usage: | ||
{{ include "nginx.podSecurityContext" .Values.pod.securityContext }} | ||
*/}} | ||
{{- define "nginx.podSecurityContext" -}} | ||
{{- $psc := . }} | ||
{{- if $psc }} | ||
securityContext: | ||
{{- if not (empty $psc.runAsUser) }} | ||
runAsUser: {{ $psc.runAsUser }} | ||
{{- end }} | ||
{{- if not (empty $psc.runAsGroup) }} | ||
runAsGroup: {{ $psc.runAsGroup }} | ||
{{- end }} | ||
{{- if not (empty $psc.fsGroup) }} | ||
fsGroup: {{ $psc.fsGroup }} | ||
{{- end }} | ||
{{- if not (empty $psc.fsGroupChangePolicy) }} | ||
fsGroupChangePolicy: {{ $psc.fsGroupChangePolicy }} | ||
{{- end }} | ||
{{- end }} | ||
{{- end -}} |
37 changes: 37 additions & 0 deletions
37
charts/operator-wandb/charts/nginx/templates/configmap.yaml
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,37 @@ | ||
apiVersion: v1 | ||
kind: ConfigMap | ||
metadata: | ||
name: {{ include "nginx.fullname" . }} | ||
labels: | ||
{{- include "nginx.commonLabels" . | nindent 4 }} | ||
{{- include "nginx.labels" . | nindent 4 }} | ||
{{- if .Values.configMap.labels -}} | ||
{{- toYaml .Values.configMap.labels | nindent 4 }} | ||
{{- end }} | ||
annotations: | ||
{{- if .Values.configMap.annotations -}} | ||
{{- toYaml .Values.configMap.annotations | nindent 4 }} | ||
{{- end }} | ||
data: | ||
nginx.conf: | | ||
worker_processes auto; | ||
error_log /var/log/nginx/error.log notice; | ||
pid /tmp/nginx.pid; | ||
events { | ||
worker_connections 1024; | ||
} | ||
http { | ||
server { | ||
listen 8080; | ||
location / { | ||
proxy_pass http://{{ .Release.Name }}-app:8080; | ||
} | ||
location /console { | ||
proxy_pass http://{{ .Release.Name }}-console:8082; | ||
} | ||
} | ||
} |
54 changes: 54 additions & 0 deletions
54
charts/operator-wandb/charts/nginx/templates/deployment.yaml
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,54 @@ | ||
{{- if .Values.enabled }} | ||
apiVersion: apps/v1 | ||
kind: Deployment | ||
metadata: | ||
annotations: | ||
{{- if .Values.deployment.annotations -}} | ||
{{- toYaml .Values.deployment.annotations | nindent 4 }} | ||
{{- end }} | ||
labels: | ||
{{- include "nginx.commonLabels" . | nindent 4 }} | ||
{{- include "nginx.labels" . | nindent 4 }} | ||
{{- if .Values.deployment.labels -}} | ||
{{- toYaml .Values.deployment.labels | nindent 4 }} | ||
{{- end }} | ||
name: {{ include "nginx.fullname" . }} | ||
spec: | ||
replicas: 1 | ||
selector: | ||
matchLabels: | ||
{{- include "nginx.labels" . | nindent 6 }} | ||
template: | ||
metadata: | ||
labels: | ||
{{- include "nginx.commonLabels" . | nindent 8 }} | ||
{{- include "nginx.podLabels" . | nindent 8 }} | ||
{{- include "nginx.labels" . | nindent 8 }} | ||
annotations: | ||
checksum/configmap: {{ include (print $.Template.BasePath "/configmap.yaml") . | sha256sum }} | ||
{{- if .Values.pod.annotations -}} | ||
{{- toYaml .Values.pod.annotations | nindent 8 }} | ||
{{- end }} | ||
spec: | ||
serviceAccountName: {{ include "nginx.serviceAccountName" . }} | ||
{{- if .tolerations }} | ||
tolerations: | ||
{{- toYaml .tolerations | nindent 8 }} | ||
{{- end }} | ||
{{- include "nginx.podSecurityContext" .Values.pod.securityContext | nindent 6 }} | ||
containers: | ||
- image: "{{ .Values.image.repository }}:{{ .Values.image.tag }}" | ||
name: {{ .Chart.Name }} | ||
resources: | ||
{{- toYaml .Values.resources | nindent 12 }} | ||
ports: | ||
- containerPort: 8080 | ||
volumeMounts: | ||
- name: nginx-config | ||
mountPath: /etc/nginx/nginx.conf | ||
subPath: nginx.conf | ||
volumes: | ||
- name: nginx-config | ||
configMap: | ||
name: {{ include "nginx.fullname" . }} | ||
{{- end }} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,22 @@ | ||
apiVersion: autoscaling/v2 | ||
kind: HorizontalPodAutoscaler | ||
metadata: | ||
name: {{ include "nginx.fullname" . }} | ||
namespace: {{ $.Release.Namespace }} | ||
labels: | ||
{{- include "nginx.commonLabels" . | nindent 4 }} | ||
{{- include "nginx.labels" . | nindent 4 }} | ||
spec: | ||
scaleTargetRef: | ||
apiVersion: apps/v1 | ||
kind: Deployment | ||
name: {{ include "nginx.fullname" . }} | ||
minReplicas: 1 | ||
maxReplicas: 1 | ||
metrics: | ||
- type: Resource | ||
resource: | ||
name: cpu | ||
target: | ||
type: Utilization | ||
averageUtilization: 70 |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,22 @@ | ||
apiVersion: v1 | ||
kind: Service | ||
metadata: | ||
name: {{ include "nginx.fullname" . }} | ||
labels: | ||
{{- include "nginx.commonLabels" . | nindent 4 }} | ||
{{- include "nginx.labels" . | nindent 4 }} | ||
{{- if .Values.service.labels -}} | ||
{{- toYaml .Values.service.labels | nindent 4 }} | ||
{{- end }} | ||
annotations: | ||
{{- if .Values.service.annotations -}} | ||
{{- toYaml .Values.service.annotations | nindent 4 }} | ||
{{- end }} | ||
spec: | ||
type: {{ .Values.service.type }} | ||
ports: | ||
- protocol: TCP | ||
port: 80 | ||
targetPort: 8080 | ||
selector: | ||
{{- include "nginx.labels" . | nindent 4 }} |
Oops, something went wrong.