Skip to content

Instantly share code, notes, and snippets.

@cdoan1
Created August 6, 2020 12:56
Show Gist options
  • Save cdoan1/9a0dc4ed769a9b0e8c8491ed1fa51463 to your computer and use it in GitHub Desktop.
Save cdoan1/9a0dc4ed769a9b0e8c8491ed1fa51463 to your computer and use it in GitHub Desktop.
2.0 create and import manifest
---
apiVersion: hive.openshift.io/v1
kind: ClusterDeployment
metadata:
name: {{ .ManagedClusterName }}
namespace: {{ .ManagedClusterName }}
labels:
cloud: {{ .ManagedClusterCloud }}
region: {{ .ManagedClusterRegion }}
vendor: {{ .ManagedClusterVendor }}
spec:
baseDomain: {{ .ManagedClusterBaseDomain }}
clusterName: {{ .ManagedClusterName }}
controlPlaneConfig:
servingCertificates: {}
installed: false
platform:
{{if (eq .ManagedClusterCloud "aws") }}
aws:
{{ end }}
{{if (eq .ManagedClusterCloud "azure") }}
azure:
baseDomainResourceGroupName: {{ .ManagedClusterBaseDomainRGN }}
{{ end }}
{{if (eq .ManagedClusterCloud "gcp") }}
gcp:
{{ end }}
credentialsSecretRef:
name: {{ .ManagedClusterName }}-creds
region: {{ .ManagedClusterRegion }}
provisioning:
installConfigSecretRef:
name: {{ .ManagedClusterName }}-install-config
sshPrivateKeySecretRef:
name: {{ .ManagedClusterName }}-ssh-private-key
imageSetRef:
#quay.io/openshift-release-dev/ocp-release:4.3.28-x86_64
name: {{ .ManagedClusterImageRefName }}
pullSecretRef:
name: {{ .ManagedClusterName }}-pull-secret
---
apiVersion: v1
kind: Secret
metadata:
name: {{ .ManagedClusterName }}-install-config
namespace: {{ .ManagedClusterName }}
type: Opaque
data:
# Base64 encoding of install-config yaml
install-config.yaml: {{ .ManagedClusterInstallConfig }}
---
apiVersion: agent.open-cluster-management.io/v1
kind: KlusterletAddonConfig
metadata:
name: {{ .ManagedClusterName }}
namespace: {{ .ManagedClusterName }}
spec:
clusterName: {{ .ManagedClusterName }}
clusterNamespace: {{ .ManagedClusterName }}
clusterLabels:
cloud: {{ .ManagedClusterCloud }}
vendor: {{ .ManagedClusterVendor }}
applicationManager:
enabled: true
policyController:
enabled: true
searchCollector:
enabled: true
certPolicyController:
enabled: true
iamPolicyController:
enabled: true
version: 2.0.0
---
apiVersion: cluster.open-cluster-management.io/v1
kind: ManagedCluster
metadata:
labels:
cloud: {{ .ManagedClusterCloud }}
name: {{ .ManagedClusterName }}
vendor: {{ .ManagedClusterVendor }}
name: {{ .ManagedClusterName }}
spec:
hubAcceptsClient: true
---
apiVersion: v1
kind: Secret
metadata:
name: {{ .ManagedClusterName }}-pull-secret
namespace: {{ .ManagedClusterName }}
stringData:
.dockerconfigjson: |-
{{ .ManagedClusterPullSecret | indent 4 }}
type: kubernetes.io/dockerconfigjson
---
apiVersion: v1
kind: Secret
metadata:
name: {{ .ManagedClusterName }}-ssh-private-key
namespace: {{ .ManagedClusterName }}
stringData:
ssh-privatekey: |-
{{ .ManagedClusterSSHPrivateKey | indent 4}}
type: Opaque
@cdoan1
Copy link
Author

cdoan1 commented Aug 6, 2020

Failure Symptom :: Root Cause

symptom cause
open-cluster-management-agent namespace is empty is the hub behind a vpn? check if you have syncset
agent namespace just has klusterlet operator, but imagepullbackoff check pull secret
is this a migration of RHACM 1.0 to 2.0, are there any missing api oc api-resources | grep False
open-cluster-maangement-agent namespace is empty, import pending klusterletaddonconfig was not created in the cluster name namespace

@cdoan1
Copy link
Author

cdoan1 commented Aug 6, 2020

Debugging Cluster Import Issues

  • import can happen when user manually tries to import an existing cluster
  • or, when creating a cluster using some automation, then wanting to import the cluster
  • or importing happens after a successful provisioning

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment