Skip to content

Commit

Permalink
* Switched the two remaining helm_resource calls to helm_remote inste…
Browse files Browse the repository at this point in the history
…ad. (the "helm releases disappearing" issue, #281, happened again, and helm_remote presumably avoids it)
  • Loading branch information
Venryx committed Mar 20, 2024
1 parent 5e12219 commit 8def743
Show file tree
Hide file tree
Showing 2 changed files with 80 additions and 80 deletions.
116 changes: 58 additions & 58 deletions Tilt/NGINX_Gateway.star
Original file line number Diff line number Diff line change
Expand Up @@ -12,55 +12,55 @@ load('./K8sUtils.star', 'NEXT_k8s_resource', 'GetLastResourceNamesBatch', 'AddRe
# ==========

def Start_NGINXGateway(g):
# helm_remote(
# chart='nginx-gateway-fabric',
# repo_name='oci://ghcr.io/nginxinc/charts',
# release_name='ngf', # affects naming of pods and such; be consistent with helm_resource below
# #version='1.1.0',
# version='0.0.0-edge',
# set=[
# "service.create=false",
# #"service.type=NodePort",
# #"service.type=LoadBalancer",
# #"service.externalIPs={15.204.30.179}",
# ],
# )
# NEXT_k8s_resource_batch(g, [
# {
# "workload": "ngf-nginx-gateway-fabric", "new_name": "ngf", "labels": ["gateway"],
# #"new_name": "ngf", "labels": ["gateway"],
# "objects": [
# "nginxgateways.gateway.nginx.org:customresourcedefinition",
# "nginx:gatewayclass",
# "ngf-nginx-gateway-fabric:serviceaccount",
# "ngf-nginx-gateway-fabric:clusterrole",
# "ngf-nginx-gateway-fabric:clusterrolebinding",
# "ngf-config:nginxgateway",
# ]
# },
# ])
helm_remote(
chart='nginx-gateway-fabric',
repo_name='oci://ghcr.io/nginxinc/charts',
release_name='ngf', # affects naming of pods and such; be consistent with helm_resource below
#version='1.1.0',
version='0.0.0-edge',
set=[
"service.create=false",
#"service.type=NodePort",
#"service.type=LoadBalancer",
#"service.externalIPs={15.204.30.179}",
],
)
NEXT_k8s_resource_batch(g, [
{
"workload": "ngf-nginx-gateway-fabric", "new_name": "ngf", "labels": ["gateway"],
#"new_name": "ngf", "labels": ["gateway"],
"objects": [
"nginxgateways.gateway.nginx.org:customresourcedefinition",
"nginx:gatewayclass",
"ngf-nginx-gateway-fabric:serviceaccount",
"ngf-nginx-gateway-fabric:clusterrole",
"ngf-nginx-gateway-fabric:clusterrolebinding",
"ngf-config:nginxgateway",
]
},
])

# avoiding helm_resource for now, until helm_resource unreliability is resolved: https://github.com/debate-map/app/issues/281
helm_resource(
chart='oci://ghcr.io/nginxinc/charts/nginx-gateway-fabric',
release_name='ngf', # affects naming of pods and such; be consistent with helm_remote above
name='ngf', # tilt resource name
# helm_resource(
# chart='oci://ghcr.io/nginxinc/charts/nginx-gateway-fabric',
# release_name='ngf', # affects naming of pods and such; be consistent with helm_remote above
# name='ngf', # tilt resource name

namespace='default',
flags=[
#'--version=1.1.0',
'--version=0.0.0-edge', # needed to support gateway-api's URLRewrite filter
'--set=service.create=false',
#'--set=service.type=NodePort',
#'--set=service.type=LoadBalancer',
#'--set=service.externalIPs={15.204.30.179}',
# namespace='default',
# flags=[
# #'--version=1.1.0',
# '--version=0.0.0-edge', # needed to support gateway-api's URLRewrite filter
# '--set=service.create=false',
# #'--set=service.type=NodePort',
# #'--set=service.type=LoadBalancer',
# #'--set=service.externalIPs={15.204.30.179}',

# attempted fix for NGF pod and deployment (and probably the gateway-class) being removed for some reason
'--set=nginxGateway.image.pullPolicy=IfNotPresent',
'--set=nginx.image.pullPolicy=IfNotPresent',
],
)
NEXT_k8s_resource_batch(g, [{"workload": "ngf", "labels": ["gateway"]}])
# # attempted fix for NGF pod and deployment (and probably the gateway-class) being removed for some reason
# '--set=nginxGateway.image.pullPolicy=IfNotPresent',
# '--set=nginx.image.pullPolicy=IfNotPresent',
# ],
# )
# NEXT_k8s_resource_batch(g, [{"workload": "ngf", "labels": ["gateway"]}])

bind_to_address = None
cluster_data = decode_yaml(local("kubectl get node -A -o yaml --context %s " % (g["CONTEXT"]), quiet = True))
Expand All @@ -87,17 +87,17 @@ def Start_NGINXGateway(g):
"TILT_PLACEHOLDER:bind_to_address": bind_to_address or '',
}))
# this must be commented when using "helm_remote" approach above (the "workload":"ngf-nginx-gateway-fabric" part grabs deployment by that name AND the service -- which is what the below references)
NEXT_k8s_resource_batch(g, [
{
"new_name": "entry-point-service-tilt", "labels": ["gateway"],
"objects": [
"ngf-nginx-gateway-fabric:service",
],
#"trigger_mode": TRIGGER_MODE_MANUAL,
# NEXT_k8s_resource_batch(g, [
# {
# "new_name": "entry-point-service-tilt", "labels": ["gateway"],
# "objects": [
# "ngf-nginx-gateway-fabric:service",
# ],
# #"trigger_mode": TRIGGER_MODE_MANUAL,

# Note: This port-forward entry actually works for all of the load-balancer-exposed services in the cluster. (since they differentiate using url-prefixes now)
# Also: We only create a port-forwards for the remote cluster, since the local cluster doesn't need it. (k8s creates one for us, due to the entry-point-service)
# NOTE: This port-forward doesn't currently work! (config may need to be more complex since now targeting a load-balancer service)
"port_forwards": '5200:80' if g["REMOTE"] else None,
},
])
# # Note: This port-forward entry actually works for all of the load-balancer-exposed services in the cluster. (since they differentiate using url-prefixes now)
# # Also: We only create a port-forwards for the remote cluster, since the local cluster doesn't need it. (k8s creates one for us, due to the entry-point-service)
# # NOTE: This port-forward doesn't currently work! (config may need to be more complex since now targeting a load-balancer service)
# "port_forwards": '5200:80' if g["REMOTE"] else None,
# },
# ])
44 changes: 22 additions & 22 deletions Tilt/Reflector.star
Original file line number Diff line number Diff line change
Expand Up @@ -15,31 +15,31 @@ def Start_Reflector(g):
# reflector
# ==========

# helm_remote('reflector',
# repo_url='https://emberstack.github.io/helm-charts',
# version='7.1.262',
# )
# NEXT_k8s_resource(g, "reflector",
# objects=[
# "reflector:clusterrole",
# "reflector:clusterrolebinding",
# "reflector:serviceaccount",
# ],
# )

# avoiding helm_resource for now, until helm_resource unreliability is resolved: https://github.com/debate-map/app/issues/281
helm_repo('emberstack', 'https://emberstack.github.io/helm-charts')
helm_resource(
'reflector',
'emberstack/reflector',
#labels=['reflector'],
flags=['--set=version=7.1.262'],
resource_deps=[
'emberstack',
'pgo_late', # this maybe fixes the errors we were hitting in postgres-operator pods, from reflector's code?
helm_remote('reflector',
repo_url='https://emberstack.github.io/helm-charts',
version='7.1.262',
)
NEXT_k8s_resource(g, "reflector",
objects=[
"reflector:clusterrole",
"reflector:clusterrolebinding",
"reflector:serviceaccount",
],
)

# avoiding helm_resource for now, until helm_resource unreliability is resolved: https://github.com/debate-map/app/issues/281
# helm_repo('emberstack', 'https://emberstack.github.io/helm-charts')
# helm_resource(
# 'reflector',
# 'emberstack/reflector',
# #labels=['reflector'],
# flags=['--set=version=7.1.262'],
# resource_deps=[
# 'emberstack',
# 'pgo_late', # this maybe fixes the errors we were hitting in postgres-operator pods, from reflector's code?
# ],
# )

k8s_yaml(ReadFileWithReplacements('../Packages/deploy/Reflector/Reflections/debate-map-pguser-admin.yaml', {
#"TILT_PLACEHOLDER:currentTime": timeOfThisTiltfileUpdate,
# only update this each time the "tilt up" command is started, not each iteration (switch back to using "timeOfThisTiltfileUpdate" if situation still problematic for new devs)
Expand Down

0 comments on commit 8def743

Please sign in to comment.