forked from stolostron/application-samples
-
Notifications
You must be signed in to change notification settings - Fork 10
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
Showing
33 changed files
with
674 additions
and
0 deletions.
There are no files selected for viewing
File renamed without changes.
File renamed without changes.
File renamed without changes.
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,26 @@ | ||
# Part of the Pacman application found in this repository | ||
|
||
## This example, Deploys nginx with an internal service, that allows reading the Cloud provider and Region json. This is designed to work with the modified Pacman application. | ||
1. Add the subscription to your Red Hat Advanced Cluster Management for Kubernetes HUB | ||
``` | ||
clone https://github.com/open-cluster-management/application-samples.git | ||
oc apply -k application-samples/subscriptoins/cloud-provider | ||
``` | ||
### results | ||
This will automatically provision the nginx with cloud provider and region identifier to: | ||
### Amazon AWS | ||
- us-east-1 | ||
- us-east-2 | ||
- us-east-3 | ||
- us-west-1 | ||
- eu-central-1 | ||
- eu-west-3 | ||
|
||
### Google GCP | ||
- europe-west3 | ||
|
||
### Azure | ||
- centralus | ||
|
||
### Related | ||
Pacman deployment with an Ansible job in: `ansible/` |
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,33 @@ | ||
apiVersion: apps/v1 | ||
kind: Deployment | ||
metadata: | ||
name: cloud-provider-nginx | ||
labels: | ||
app.kubernetes.io/name: nginx-cp | ||
spec: | ||
replicas: 1 | ||
selector: | ||
matchLabels: | ||
app.kubernetes.io/name: nginx-cp | ||
template: | ||
metadata: | ||
labels: | ||
app.kubernetes.io/name: nginx-cp | ||
spec: | ||
containers: | ||
- name: nginx | ||
image: quay.io/jpacker/nginx:1.16.1 | ||
ports: | ||
- containerPort: 8080 | ||
imagePullPolicy: Always | ||
env: | ||
- name: CLOUD_PROVIDER | ||
value: "Amazon" | ||
- name: ZONE | ||
value: "eu-central-1" | ||
volumeMounts: | ||
- mountPath: /app/provider | ||
name: cache-provider | ||
volumes: | ||
- name: cache-provider | ||
emptyDir: {} |
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,33 @@ | ||
apiVersion: apps/v1 | ||
kind: Deployment | ||
metadata: | ||
name: cloud-provider-nginx | ||
labels: | ||
app.kubernetes.io/name: nginx-cp | ||
spec: | ||
replicas: 1 | ||
selector: | ||
matchLabels: | ||
app.kubernetes.io/name: nginx-cp | ||
template: | ||
metadata: | ||
labels: | ||
app.kubernetes.io/name: nginx-cp | ||
spec: | ||
containers: | ||
- name: nginx | ||
image: quay.io/jpacker/nginx:1.16.1 | ||
ports: | ||
- containerPort: 8080 | ||
imagePullPolicy: Always | ||
env: | ||
- name: CLOUD_PROVIDER | ||
value: "Amazon" | ||
- name: ZONE | ||
value: "eu-west-3" | ||
volumeMounts: | ||
- mountPath: /app/provider | ||
name: cache-provider | ||
volumes: | ||
- name: cache-provider | ||
emptyDir: {} |
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,33 @@ | ||
apiVersion: apps/v1 | ||
kind: Deployment | ||
metadata: | ||
name: cloud-provider-nginx | ||
labels: | ||
app.kubernetes.io/name: nginx-cp | ||
spec: | ||
replicas: 1 | ||
selector: | ||
matchLabels: | ||
app.kubernetes.io/name: nginx-cp | ||
template: | ||
metadata: | ||
labels: | ||
app.kubernetes.io/name: nginx-cp | ||
spec: | ||
containers: | ||
- name: nginx | ||
image: quay.io/jpacker/nginx:1.16.1 | ||
ports: | ||
- containerPort: 8080 | ||
imagePullPolicy: Always | ||
env: | ||
- name: CLOUD_PROVIDER | ||
value: "Amazon" | ||
- name: ZONE | ||
value: "us-east-1" | ||
volumeMounts: | ||
- mountPath: /app/provider | ||
name: cache-provider | ||
volumes: | ||
- name: cache-provider | ||
emptyDir: {} |
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,33 @@ | ||
apiVersion: apps/v1 | ||
kind: Deployment | ||
metadata: | ||
name: cloud-provider-nginx | ||
labels: | ||
app.kubernetes.io/name: nginx-cp | ||
spec: | ||
replicas: 1 | ||
selector: | ||
matchLabels: | ||
app.kubernetes.io/name: nginx-cp | ||
template: | ||
metadata: | ||
labels: | ||
app.kubernetes.io/name: nginx-cp | ||
spec: | ||
containers: | ||
- name: nginx | ||
image: quay.io/jpacker/nginx:1.16.1 | ||
ports: | ||
- containerPort: 8080 | ||
imagePullPolicy: Always | ||
env: | ||
- name: CLOUD_PROVIDER | ||
value: "Amazon" | ||
- name: ZONE | ||
value: "us-east-2" | ||
volumeMounts: | ||
- mountPath: /app/provider | ||
name: cache-provider | ||
volumes: | ||
- name: cache-provider | ||
emptyDir: {} |
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,33 @@ | ||
apiVersion: apps/v1 | ||
kind: Deployment | ||
metadata: | ||
name: cloud-provider-nginx | ||
labels: | ||
app.kubernetes.io/name: nginx-cp | ||
spec: | ||
replicas: 1 | ||
selector: | ||
matchLabels: | ||
app.kubernetes.io/name: nginx-cp | ||
template: | ||
metadata: | ||
labels: | ||
app.kubernetes.io/name: nginx-cp | ||
spec: | ||
containers: | ||
- name: nginx | ||
image: quay.io/jpacker/nginx:1.16.1 | ||
ports: | ||
- containerPort: 8080 | ||
imagePullPolicy: Always | ||
env: | ||
- name: CLOUD_PROVIDER | ||
value: "Amazon" | ||
- name: ZONE | ||
value: "us-west-3" | ||
volumeMounts: | ||
- mountPath: /app/provider | ||
name: cache-provider | ||
volumes: | ||
- name: cache-provider | ||
emptyDir: {} |
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,33 @@ | ||
apiVersion: apps/v1 | ||
kind: Deployment | ||
metadata: | ||
name: cloud-provider-nginx | ||
labels: | ||
app.kubernetes.io/name: nginx-cp | ||
spec: | ||
replicas: 1 | ||
selector: | ||
matchLabels: | ||
app.kubernetes.io/name: nginx-cp | ||
template: | ||
metadata: | ||
labels: | ||
app.kubernetes.io/name: nginx-cp | ||
spec: | ||
containers: | ||
- name: nginx | ||
image: quay.io/jpacker/nginx:1.16.1 | ||
ports: | ||
- containerPort: 8080 | ||
imagePullPolicy: Always | ||
env: | ||
- name: CLOUD_PROVIDER | ||
value: "Amazon" | ||
- name: ZONE | ||
value: "us-west-1" | ||
volumeMounts: | ||
- mountPath: /app/provider | ||
name: cache-provider | ||
volumes: | ||
- name: cache-provider | ||
emptyDir: {} |
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,33 @@ | ||
apiVersion: apps/v1 | ||
kind: Deployment | ||
metadata: | ||
name: cloud-provider-nginx | ||
labels: | ||
app.kubernetes.io/name: nginx-cp | ||
spec: | ||
replicas: 1 | ||
selector: | ||
matchLabels: | ||
app.kubernetes.io/name: nginx-cp | ||
template: | ||
metadata: | ||
labels: | ||
app.kubernetes.io/name: nginx-cp | ||
spec: | ||
containers: | ||
- name: nginx | ||
image: quay.io/jpacker/nginx:1.16.1 | ||
ports: | ||
- containerPort: 8080 | ||
imagePullPolicy: Always | ||
env: | ||
- name: CLOUD_PROVIDER | ||
value: "Azure" | ||
- name: ZONE | ||
value: "centralus" | ||
volumeMounts: | ||
- mountPath: /app/provider | ||
name: cache-provider | ||
volumes: | ||
- name: cache-provider | ||
emptyDir: {} |
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,33 @@ | ||
apiVersion: apps/v1 | ||
kind: Deployment | ||
metadata: | ||
name: cloud-provider-nginx | ||
labels: | ||
app.kubernetes.io/name: nginx-cp | ||
spec: | ||
replicas: 1 | ||
selector: | ||
matchLabels: | ||
app.kubernetes.io/name: nginx-cp | ||
template: | ||
metadata: | ||
labels: | ||
app.kubernetes.io/name: nginx-cp | ||
spec: | ||
containers: | ||
- name: nginx | ||
image: quay.io/jpacker/nginx:1.16.1 | ||
ports: | ||
- containerPort: 8080 | ||
imagePullPolicy: Always | ||
env: | ||
- name: CLOUD_PROVIDER | ||
value: "Google" | ||
- name: ZONE | ||
value: "europe-west3" | ||
volumeMounts: | ||
- mountPath: /app/provider | ||
name: cache-provider | ||
volumes: | ||
- name: cache-provider | ||
emptyDir: {} |
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,4 @@ | ||
namespace: provider | ||
resources: | ||
- service.yaml | ||
- 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,12 @@ | ||
apiVersion: v1 | ||
kind: Service | ||
metadata: | ||
name: cloud | ||
spec: | ||
selector: | ||
app.kubernetes.io/name: nginx-cp | ||
ports: | ||
- name: http | ||
protocol: TCP | ||
port: 8080 | ||
targetPort: 8080 |
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,10 @@ | ||
--- | ||
apiVersion: app.k8s.io/v1beta1 | ||
kind: Application | ||
metadata: | ||
name: cloud | ||
namespace: provider | ||
spec: | ||
selector: | ||
matchLabels: | ||
app: cloud |
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,19 @@ | ||
resources: | ||
- namespace.yaml | ||
#- secret.yaml | ||
- ../channelchannel.yaml | ||
- placementrule-a-us1.yaml | ||
- placementrule-a-us2.yaml | ||
- placementrule-a-eu1.yaml | ||
- placementrule-a-eu3.yaml | ||
- placementrule-g-eu3.yaml | ||
- placementrule-a-uw1.yaml | ||
- placementrule-az-cus.yaml | ||
- subscription-provider-a-us1.yaml | ||
- subscription-provider-a-us2.yaml | ||
- subscription-provider-a-eu1.yaml | ||
- subscription-provider-a-eu3.yaml | ||
- subscription-provider-g-eu3.yaml | ||
- subscription-provider-a-uw1.yaml | ||
- subscription-provider-az-cus.yaml | ||
- application.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,11 @@ | ||
--- | ||
apiVersion: v1 | ||
kind: Namespace | ||
metadata: | ||
name: demo | ||
--- | ||
apiVersion: v1 | ||
kind: Namespace | ||
metadata: | ||
name: provider | ||
|
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,16 @@ | ||
apiVersion: apps.open-cluster-management.io/v1 | ||
kind: PlacementRule | ||
metadata: | ||
name: cloud-provider-a-eu1 | ||
namespace: provider | ||
labels: | ||
app: cloud | ||
spec: | ||
clusterConditions: | ||
- type: ManagedClusterConditionAvailable | ||
status: "True" | ||
clusterSelector: | ||
matchLabels: | ||
cloud: Amazon | ||
region: eu-central-1 | ||
#clusterReplicas: 1 #Apply to how many matched clusters, default is ALL |
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,16 @@ | ||
apiVersion: apps.open-cluster-management.io/v1 | ||
kind: PlacementRule | ||
metadata: | ||
name: cloud-provider-a-eu3 | ||
namespace: provider | ||
labels: | ||
app: cloud | ||
spec: | ||
clusterConditions: | ||
- type: ManagedClusterConditionAvailable | ||
status: "True" | ||
clusterSelector: | ||
matchLabels: | ||
cloud: Amazon | ||
region: eu-west-3 | ||
#clusterReplicas: 1 #Apply to how many matched clusters, default is ALL |
Oops, something went wrong.