This file contains hidden or 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
#!/bin/bash | |
packer plugins install github.com/hashicorp/virtualbox | |
# Detect the active network interface | |
if ip link show eth0 | grep -q "state UP"; then | |
BRIDGE_INTERFACE="eth0" | |
elif ip link show en0 | grep -q "state UP"; then | |
BRIDGE_INTERFACE="en0" | |
else | |
echo "No active network interface found!" |
This file contains hidden or 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
apiVersion: v1 | |
kind: Service | |
metadata: | |
name: hello-world-service | |
spec: | |
ports: | |
- name: public | |
port: 80 | |
targetPort: 80 | |
type: NodePort |
This file contains hidden or 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
# path: hello-world/overlays/staging/kustomization.yaml | |
apiVersion: kustomize.config.k8s.io/v1beta1 | |
kind: Kustomization | |
bases: | |
- ../base | |
patchesStrategicMerge: | |
- patch-replicas.yaml |
This file contains hidden or 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
# path: hello-world/overlays/staging/patch-replicas.yaml | |
apiVersion: apps/v1 | |
kind: Deployment | |
metadata: | |
name: hello-world-deployment | |
spec: | |
replicas: 3 |
This file contains hidden or 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
apiVersion: v1 | |
kind: Service | |
metadata: | |
name: hello-world-service | |
spec: | |
ports: | |
- name: public | |
port: 80 | |
targetPort: 80 | |
type: NodePort |
This file contains hidden or 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
# path: hello-world/base/service.yaml | |
apiVersion: v1 | |
kind: Service | |
metadata: | |
name: hello-world-service | |
spec: | |
type: NodePort | |
ports: | |
- name: public | |
port: 80 |
This file contains hidden or 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
# path: hello-world/base/deployment.yaml | |
apiVersion: apps/v1 | |
kind: Deployment | |
metadata: | |
name: hello-world-deployment | |
spec: | |
replicas: 1 | |
template: | |
spec: | |
containers: |
This file contains hidden or 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
# path: hello-world/base/kustomization.yaml | |
apiVersion: kustomize.config.k8s.io/v1beta1 | |
kind: Kustomization | |
resources: | |
- deployment.yaml | |
- service.yaml |
This file contains hidden or 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
hello-world/ | |
├── base | |
│ ├── deployment.yaml | |
│ ├── kustomization.yaml | |
│ └── service.yaml | |
└── overlays | |
├── prod | |
│ ├── kustomization.yaml | |
│ └── patch.yaml | |
└── staging |
This file contains hidden or 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
apiVersion: v1 | |
kind: Service | |
metadata: | |
labels: | |
test-app: test | |
name: test | |
namespace: default | |
spec: | |
externalTrafficPolicy: Cluster | |
ports: |
NewerOlder